Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gitdallas opened this issue Sep 19, 2023 · 0 comments · Fixed by #9646
Assignees
Labels
Milestone

Comments

@gitdallas
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants