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.

Merge branch 'main' into navigator-dnd

Roman Pominov986235de94dc
diff --cc apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx
index 5e39324f6d,426ddce932..3cece599d3
--- a/apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx
+++ b/apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx
@@@ -10,7 -10,8 +10,7 @@@ import
} from "@webstudio-is/react-sdk";
import { useBreakpoints, useTextEditingInstanceId } from "~/shared/nano-states";
import { useCss } from "./use-css";
- import { EditorMemoized, useContentEditable } from "./text-editor";
-import { useEnsureFocus } from "./use-ensure-focus";
+ import { Editor } from "./text-editor";
import noop from "lodash.noop";
import { useSelectedElement } from "~/canvas/shared/nano-states";
@@@ -31,17 -32,15 +31,13 @@@ export const WrapperComponentDev = (
const className = useCss({ instance, css });
const [editingInstanceId] = useTextEditingInstanceId();
const [, setSelectedElement] = useSelectedElement();
- const isEditing = editingInstanceId === instance.id;
- const [editableRefCallback, editableProps] = useContentEditable(isEditing);
- const focusRefCallback = useEnsureFocus();
const refCallback = useCallback(
(element) => {
- if (isEditing) editableRefCallback(element);
-
- focusRefCallback(element);
// When entering text editing we unmount the instance element, so we need to update the reference, otherwise we have a detached element referenced and bounding box will be wrong.
if (element !== null) setSelectedElement(element);
},
- [editableRefCallback, setSelectedElement, isEditing]
- [focusRefCallback, setSelectedElement]
++ [setSelectedElement]
);
const userProps = useUserProps(instance.id);