From d13170ff5797c4c7c8940663d6be9d6c96770e2a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 Nov 2021 13:17:34 +0000 Subject: [PATCH] Disable drag and drop for components in the selected path when edit mode is enabled to fix firefox issue with text selection when draggable attribute is set --- packages/client/src/components/Component.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index 5ea7a5ea84..e3e4502a10 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -63,6 +63,7 @@ $: selected = $builderStore.inBuilder && $builderStore.selectedComponentId === id $: inSelectedPath = $builderStore.selectedComponentPath?.includes(id) + $: inDragPath = inSelectedPath && $builderStore.editMode // Interactive components can be selected, dragged and highlighted inside // the builder preview @@ -72,7 +73,7 @@ !isBlock $: editable = definition.editable $: editing = editable && selected && $builderStore.editMode - $: draggable = !editing && interactive && !isLayout && !isScreen + $: draggable = !inDragPath && interactive && !isLayout && !isScreen $: droppable = interactive && !isLayout && !isScreen // Empty components are those which accept children but do not have any.