Skip to content

Commit

Permalink
fix: Disable hover while resizing block
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Jan 9, 2025
1 parent 03c4d22 commit da25cbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/BoxResizer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/BuilderCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -265,6 +266,7 @@ defineExpose({
scrollBlockIntoView,
removeBlock,
selectBlockRange,
resizingBlock,
});
function selectBreakpoint(ev: MouseEvent, breakpoint: BreakpointConfig) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/useBlockEventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit da25cbe

Please sign in to comment.