-
Notifications
You must be signed in to change notification settings - Fork 3.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
Dropdown won't open after launching Modal in React v17-RC #5409
Comments
Traced this down to |
This is due to how react 17 handles event delegation. Previously react always listened on the document for all events. In 17 it listens on the render "root" instead. The core issue here is root close logic is assuming specific ordering between it's native handlers and when react responds to the same event, but that order is now different |
I just ran into this bug as React 17.0.0 has just been officially released. I'm guessing therefore that many will try upgrading and hit this bug. I'm going to revert to React 16.14.0 until fixed as I'm not sure if there is a workaround? |
no workaround at the moment, gonna try and block off some time to fix this today |
The dropdown button would stop working after a modal was opened. After a 🌦 day of pulling my 🦱 out trying to figure out what had happened. Finally found this: react-bootstrap/react-bootstrap#5409 Had to thunk React back down to 16.14.0
I made it working by using the good old stopPropagation. Attach an |
- See: react-bootstrap/react-bootstrap#5409 - The work around is here: react-bootstrap/react-bootstrap#5409 (comment) - package.json was changed to bring in React ⚛ v17.0.1
This issue also seems to be affecting Apologies if this comment is in the wrong place. |
This has been fixed and released in react-overlays 4.1.1. Clear react-overlays from your node_modules folder and run an install again. React-bootstrap installs it as a transitive dependency and should pick up the latest version. |
The same issue exists in 0.33.1. Should we expect a fix for Bootstrap 3 as well? Should I create a new issue for this? P.S. The |
@codingstill I’ll look into this for BS3 |
Fix for `Dropdown` from `react-bootstrap` bug. Look [this issue](react-bootstrap/react-bootstrap#5409).
Fix for `Dropdown` from `react-bootstrap` bug. Look [this issue](react-bootstrap/react-bootstrap#5409).
It looks like react-overlays 4.1.1 is not compatible with react-bootstrap 0.33.1 (Bootstrap 3). react-bootstrap 0.33.1 imports from Any workarounds for those still on Bootstrap 3 (react-bootstrap 0.33.1)?
|
There's a fix in the BS3-compatible react-overlays branch but no release yet. cc @jquense |
@kyletsang is there any open issue for BS3 we can watch? thank you |
Using react-bootstrap 0.32, I can confirm @karesztrk 's stop propagation fix worked perfectly. Only have one drop-down, so who knows. I recently upgraded CRA to 4.x, and React to 17, so I've encountered a few hiccups (really smooth all things considered though) The cost to switch 1.x is not worth it for me, especially with the code-splitting that already comes with 0.32 ("react-bootstrap/lib/Dropdown") HOWEVER, the uncontrolled drop-down component has an |
FYI to googlers: not just |
- Added components: - ClientButton.tsx - ClientDobButton.tsx - App.tsx now imports the above buttons. - ClientButton allows for opening the edit modal, printing medbox labels, copying the name to the clipboard and launching HMIS, and switching clients. - ClientDobButton shows client notes. - Added workaround for dropdown buttons stopping working in React 17 due to the way mouse events are handled. - See react-bootstrap/react-bootstrap#5409 (comment) - Closes #124
Describe the bug
I'm currently preparing to update my React version to v17 for a react-bootstrap-based application.
In the process, I find that Dropdown won't open on the same page when launching a modal.
To Reproduce
Reproducible Example
https://codesandbox.io/s/react-playground-forked-ojvpm
Expected behavior
Dropdown opens without any problems after launching a modal, just as it did with React v16.
Environment (please complete the following information)
The text was updated successfully, but these errors were encountered: