fix: image outline on load (#5230)

This commit is contained in:
Aaryan Khandelwal 2024-07-29 11:24:23 +05:30 committed by GitHub
parent 2c609670c8
commit 4a9e09a54a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,7 @@ export const ImageResizer = ({ editor }: { editor: Editor }) => {
return ( return (
<> <>
<Moveable <Moveable
target={document.querySelector(".ProseMirror-selectednode") as HTMLElement} target={document.querySelector(".active-editor .ProseMirror-selectednode") as HTMLElement}
container={null} container={null}
origin={false} origin={false}
edge={false} edge={false}
@ -39,7 +39,7 @@ export const ImageResizer = ({ editor }: { editor: Editor }) => {
resizable resizable
throttleResize={0} throttleResize={0}
onResizeStart={() => { onResizeStart={() => {
const imageInfo = document.querySelector(".ProseMirror-selectednode") as HTMLImageElement; const imageInfo = document.querySelector(".active-editor .ProseMirror-selectednode") as HTMLImageElement;
if (imageInfo) { if (imageInfo) {
const originalWidth = Number(imageInfo.width); const originalWidth = Number(imageInfo.width);
const originalHeight = Number(imageInfo.height); const originalHeight = Number(imageInfo.height);