fix: Various compounding memory leaks in editor (#5950)

This commit is contained in:
Tom Moor
2023-10-05 20:01:27 -04:00
committed by GitHub
parent a2f037531a
commit eb71a8f933
5 changed files with 46 additions and 50 deletions

View File

@@ -29,10 +29,10 @@ const Image = (props: Props) => {
const [loaded, setLoaded] = React.useState(false);
const [naturalWidth, setNaturalWidth] = React.useState(node.attrs.width);
const [naturalHeight, setNaturalHeight] = React.useState(node.attrs.height);
const documentBounds = useComponentSize(props.view.dom);
const containerBounds = useComponentSize(
document.body.querySelector("#full-width-container")
);
const documentBounds = props.view.dom.getBoundingClientRect();
const maxWidth = layoutClass
? documentBounds.width / 3
: documentBounds.width;