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

Menu does not close when using on reactstrap modal #775

Closed
HansAarneLiblik opened this issue Mar 15, 2023 · 3 comments
Closed

Menu does not close when using on reactstrap modal #775

HansAarneLiblik opened this issue Mar 15, 2023 · 3 comments
Labels

Comments

@HansAarneLiblik
Copy link

HansAarneLiblik commented Mar 15, 2023

I have an issue when using react-bootstrap-typeahead together with reactstrap. (This works with react-bootstrap, but migrating would be a huge effort).

When the Typeahead is on modal and menu is open, the menu won't close when clicking away from the component (As testable in codesandbox). Menu DOES close, when selecting an item though, but there are cases when user does not actually want to select anything.

We could create a wrapper and handle menu open/close state ourselves, but would prefer not to, if possible

Version

6.0.2

Steps to reproduce

Sandbox: https://codesandbox.io/s/reactstrap-bug-lu30xq

  1. Open the modal
  2. Click on input
  3. Click away from the input (in modal)

image

Expected Behavior

Menu closes when focus is removed (Clicked anywhere on the modal, not backdrop)

Actual Behavior

Menu does not close

@HansAarneLiblik
Copy link
Author

Also opened a bug report on reactstrap reactstrap/reactstrap#2718

@ericgio
Copy link
Owner

ericgio commented Mar 15, 2023

Hey @HansAarneLiblik thanks for opening this issue. I believe this is an issue with either Reactstrap or React-Overlays's useRootClose hook, which this library uses to control the menu visibility. Here's a minimal repro using just useRootClose.

@ericgio ericgio closed this as completed Mar 15, 2023
@GABuryan
Copy link

@HansAarneLiblik This is not a reactstrap issue. This is a react problem. On React version 16.8 - worked. On React version >17 - not worked.

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

No branches or pull requests

3 participants