-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Unable to find drag handle when id is integer #1512
Comments
This is a tricky one as we do state that |
Perhaps we should throw if |
|
That sounds like a good idea! I will try to write a PR for this check |
Don't worry about creating a PR @SiebeVE. I'll make the change as I want to test out a few things with it |
This has been changed in |
Probably should be in the docs... |
Expected behavior
When using a
draggableId
that is an int, the library is unable to find the drag handle.This is due to the strict check on: https://github.com/atlassian/react-beautiful-dnd/blob/dev/src/view/get-elements/find-draggable.js#L17.
We get this id by fetching it from the dom, but comparing it to the id received from react (that can be an int or a string)
Actual behavior
Renders with errors and doesn't enable drag 'n drop.
Given error:
Steps to reproduce
Create a component and make sure you give the draggable id an integer value
Suggested solution?
Don't use a strict check or cast to integer when possible?
What version of
React
are you using?16.9.0
What version of
react-beautiful-dnd
are you running?12.0.0-beta-1
What browser are you using?
Latest chrome
Demo
https://codesandbox.io/embed/vertical-list-vs189
The text was updated successfully, but these errors were encountered: