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

The HTML5Backend should determine draggable from canDrag #2909

Closed
anuraags opened this issue Dec 14, 2020 · 0 comments · Fixed by #3187
Closed

The HTML5Backend should determine draggable from canDrag #2909

anuraags opened this issue Dec 14, 2020 · 0 comments · Fixed by #3187

Comments

@anuraags
Copy link

Is your feature request related to a problem? Please describe.

Currently there is a canDrag predicate that can be assigned to a drag source in react-dnd. However, the HTML5Backend currently sets "draggable" to true for a drag source regardless what this predicate returns. It should actually set the draggable property in this line:

node.setAttribute('draggable', 'true')

based on canDrag from the monitor or options.

This can allow developers to prevent bugs such as this one:
#438

by setting canDrag based on a focus predicate.

Describe the solution you'd like

That when canDrag is false for a drag source, the draggable attribute for that drag source ref is set to false.

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

Successfully merging a pull request may close this issue.

1 participant