-
Notifications
You must be signed in to change notification settings - Fork 408
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
toggleMenu
not working with react-dom 17
#608
Comments
Hi @alex84G, thanks for your question. Unfortunately, it's hard for me to help without additional information. Please follow the issue template and include a thorough description of your problem. Code examples or sandboxes are extremely helpful as well. Thank you! |
Hi @ericgio, I've updated my issue and added a sandbox. |
@alex84G: Thanks for providing the sandbox. The problem appears to be related to Edit: It looks like the event handling has changed such that the |
As a workaround, you can stop the event propagation in your click handler: <button
onClick={(event) => {
event.stopPropagation();
ref.current.toggleMenu();
}}>
Open
</button> |
toggleMenu
not working with react-dom 17
Turns out this was related to an issue with react-overlays. Upgrading to the latest version seems to have solved the problem. |
Version
5.1.2
Steps to reproduce
In want to fire the toggleMenu() method from a button.
There is an example of how to fire the public methods: https://ericgio.github.io/react-bootstrap-typeahead/#public-methods
But the toggleMenu() method is not working. In this stackoverflow answer someone mentioned, that the public methods are not listed in the type definitions.
Sandbox: https://codesandbox.io/s/purple-sunset-dhikf?fontsize=14&hidenavigation=1&theme=dark
Expected Behavior
toggleMenu() should open the dropdown.
Actual Behavior
toggleMenu() is not fired.
The text was updated successfully, but these errors were encountered: