Skip to content

Commit 444ad03

Browse files
committed
refactor: don't override dnd reference if using dragRef with DropZones
1 parent 29e5580 commit 444ad03

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/core/components/DropZone/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ const DropZoneEdit = forwardRef<HTMLDivElement, DropZoneProps>(
242242
}}
243243
data-testid={`dropzone:${zoneCompound}`}
244244
data-puck-dropzone={zoneCompound}
245-
data-puck-dnd={zoneCompound}
246245
style={
247246
{
248247
...style,

packages/core/lib/dnd/NestedDroppablePlugin.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ const getPointerCollisions = (
9696
for (let i = 0; i < elements.length; i++) {
9797
const element = elements[i];
9898

99+
const dropzoneId = element.getAttribute("data-puck-dropzone");
100+
101+
if (dropzoneId) {
102+
const droppable = manager.registry.droppables.get(dropzoneId);
103+
104+
if (droppable) {
105+
candidates.push(droppable);
106+
}
107+
}
108+
99109
const id = element.getAttribute("data-puck-dnd");
100110

101111
if (id) {

0 commit comments

Comments
 (0)