Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix setRootElement

Oleg Isonen085f7836ff64
diff --git a/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx b/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx
index d917271880..6f630ab5f9 100644
--- a/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx
+++ b/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx
@@ -23,7 +23,8 @@ const Editor = ({ instance, editable, onChange }: EditorProps) => {
const [element] = useSelectedElement();
useEffect(() => {
- if (element === undefined) editor.setRootElement(element);
+ if (element === undefined) return;
+ editor.setRootElement(element);
return () => {
editor.setRootElement(null);
};
diff --git a/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx b/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx
index 655c6ff1fc..6d4ef29815 100644
--- a/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx
+++ b/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx
@@ -1,6 +1,6 @@
import { memo, lazy, Suspense } from "react";
-const EditorLazy = lazy(() => import("./editor.tsx"));
+const EditorLazy = lazy(() => import("./editor"));
const EditorWithSuspense = (props) => {
return (