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.

disable the outline when hovering an inline instance during parent text editing

Oleg Isonen7238cba73501
diff --git a/app/canvas/features/wrapper-component/wrapper-component.tsx b/app/canvas/features/wrapper-component/wrapper-component.tsx
index c13cf6d61d..62b2c76294 100644
--- a/app/canvas/features/wrapper-component/wrapper-component.tsx
+++ b/app/canvas/features/wrapper-component/wrapper-component.tsx
@@ -129,6 +129,7 @@ export const InlineWrapperComponentDev = ({
<Component
{...rest}
{...userProps}
+ data-outline-disabled
key={instance.id}
// @todo stop using id to free it up to the user
id={instance.id}
diff --git a/app/canvas/shared/use-track-hovered-element.ts b/app/canvas/shared/use-track-hovered-element.ts
index 872828b03d..5de85a2ab6 100644
--- a/app/canvas/shared/use-track-hovered-element.ts
+++ b/app/canvas/shared/use-track-hovered-element.ts
@@ -14,7 +14,11 @@ export const useTrackHoveredElement = () => {
useEffect(() => {
const handleMouseOver = (event: MouseEvent) => {
const element = event.target;
- if (rootInstance === undefined || !(element instanceof HTMLElement)) {
+ if (
+ rootInstance === undefined ||
+ !(element instanceof HTMLElement) ||
+ element.dataset.outlineDisabled
+ ) {
return;
}
setHoveredElement(element);