Skip to content

Commit

Permalink
fix: Update drop target even if shiftKey is pressed
Browse files Browse the repository at this point in the history
- Allows replacing of image when the shiftKey is pressed while dropping the file
  • Loading branch information
surajshetty3416 committed Feb 20, 2025
1 parent e22c9ea commit c7b97d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/utils/useCanvasDropZone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function useCanvasDropZone(
const parentBlock = getBlockToReplace(ev);
if (parentBlock) {
store.hoveredBlock = parentBlock.blockId;
updateDropTarget(ev, parentBlock, 0, "column");
store.removeDropPlaceholder();
}
} else {
Expand Down Expand Up @@ -197,7 +198,6 @@ export function useCanvasDropZone(
newBlock.extendFromComponent(componentName);
// if shift key is pressed, replace parent block with new block
if (ev.shiftKey) {
parentBlock = getBlockToReplace(ev);
if (!parentBlock) return;
const parentParentBlock = parentBlock.getParentBlock();
if (!parentParentBlock) return;
Expand Down

0 comments on commit c7b97d6

Please sign in to comment.