This commit is contained in:
Rainer Simon 2021-10-07 21:34:31 +02:00
parent 9abf457f41
commit 61d2c43e04
1 changed files with 4 additions and 2 deletions

View File

@ -67,8 +67,10 @@ export default class Editor extends Component {
// This makes sure the editor is repositioned if the widgets change
const observer = new MutationObserver(debounce(() => {
this.removeObserver && this.removeObserver();
this.removeObserver = this.initResizeObserver();
if (this.element.current) {
this.removeObserver && this.removeObserver();
this.removeObserver = this.initResizeObserver();
}
}));
observer.observe(this.element.current, { childList: true, subtree: true });