diff --git a/frontend/src/components/BoxResizer.vue b/frontend/src/components/BoxResizer.vue index 26913e67..78f5ee5b 100644 --- a/frontend/src/components/BoxResizer.vue +++ b/frontend/src/components/BoxResizer.vue @@ -60,10 +60,16 @@ onMounted(() => { watch(resizing, () => { if (resizing.value) { - store.activeCanvas?.history?.pause(); + if (store.activeCanvas) { + store.activeCanvas.history?.pause(); + store.activeCanvas.resizingBlock = true; + } emit("resizing", true); } else { - store.activeCanvas?.history?.resume(undefined, true, true); + if (store.activeCanvas) { + store.activeCanvas?.history?.resume(undefined, true, true); + store.activeCanvas.resizingBlock = false; + } emit("resizing", false); } }); diff --git a/frontend/src/components/BuilderCanvas.vue b/frontend/src/components/BuilderCanvas.vue index 4ee19963..9f11bb39 100644 --- a/frontend/src/components/BuilderCanvas.vue +++ b/frontend/src/components/BuilderCanvas.vue @@ -92,6 +92,7 @@ import setPanAndZoom from "../utils/panAndZoom"; import BlockSnapGuides from "./BlockSnapGuides.vue"; import BuilderBlock from "./BuilderBlock.vue"; import FitScreenIcon from "./Icons/FitScreen.vue"; +const resizingBlock = ref(false); const store = useStore(); const canvasContainer = ref(null); @@ -265,6 +266,7 @@ defineExpose({ scrollBlockIntoView, removeBlock, selectBlockRange, + resizingBlock, }); function selectBreakpoint(ev: MouseEvent, breakpoint: BreakpointConfig) { diff --git a/frontend/src/utils/useBlockEventHandlers.ts b/frontend/src/utils/useBlockEventHandlers.ts index 2e06ac41..d1f85e0e 100644 --- a/frontend/src/utils/useBlockEventHandlers.ts +++ b/frontend/src/utils/useBlockEventHandlers.ts @@ -57,7 +57,7 @@ export function useBlockEventHandlers() { function handleMouseOver(e: MouseEvent) { if (!isBlock(e)) return; - if (store.mode === "move") return; + if (store.mode === "move" || store.activeCanvas?.resizingBlock) return; const block = getBlock(e); const { breakpoint } = getBlockInfo(e); store.hoveredBlock = block?.blockId || null;