Skip to content

Bug - Draggable - Droppable gets disabled when attempting to drop an item that onDrag returns false #9645

@gitdallas

Description

@gitdallas

Describe the problem
If the onDrag returns false on a Draggable item, the Droppable will become disabled in a dragging state.

How do you reproduce the problem?
Test by setting onDrag={() => false} on the DragDrop in an example https://www.patternfly.org/components/drag-and-drop#basic

Expected behavior
You cannot drag an item that returns false for onDrag, but it also should not set the dragging modifier on the Droppable element.

Any other information?
From this convo: https://patternfly.slack.com/archives/C4FM977N0/p1695122245413489

Looks like in Draggable.tsx when we check !onDrag(...), we could do droppableItems.forEach(item => resetDroppableItem(item)); before returning.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions