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

disabled prop doesn't work when updating it programatically #12

Open
mauriciosoares opened this issue Jun 20, 2019 · 1 comment
Open

Comments

@mauriciosoares
Copy link

mauriciosoares commented Jun 20, 2019

When I update the value from the disabled prop, the component does not react to its change, unless it's unmounted and mounted again. Meaning that if I set disabled to true using a button in the UI for example, the drag and drop functionality is still working.

Here's a example of the bug with the latest version of react-drag-list and a demo I got from the docs: https://codesandbox.io/s/laughing-dew-4gghz

@mauriciosoares
Copy link
Author

For people having this issue, a way to work around this is to set a key prop to ReactDragList, and change it whenever you change the disabled prop.

This will cause the component to remount, and the disabled works as expected

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

No branches or pull requests

1 participant