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

Unexpected call to onMenuClose on input blur. #3876

Closed
rcgillet opened this issue Dec 6, 2019 · 1 comment
Closed

Unexpected call to onMenuClose on input blur. #3876

rcgillet opened this issue Dec 6, 2019 · 1 comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet issue/reviewed Issue has recently been reviewed (mid-2020)

Comments

@rcgillet
Copy link

rcgillet commented Dec 6, 2019

There is a call to onMenuClose on every input blur, even when the menu has already been closed from another action.

Steps to reproduce:

  1. Pass in an onBlur and onMenuClose function to the Select component.
  2. Open the menu and make a selection. (onMenuClose is fired)
  3. Hit tab or a similar action that would take the focus off of the input. (Both onBlur and onMenuClose are fired)

CodeSandbox reproducing the issue: https://codesandbox.io/s/admiring-bardeen-pu0rg

I was looking through the codebase and found that onMenuClose is being called regardless of the value of menuIsOpen. Link to code

Adding a conditional for menuIsOpen should fix the issue I believe. I would be happy to submit a PR if you believe that the approach I am proposing makes sense.

@bladey bladey added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Jun 1, 2020
@bladey bladey added the issue/reviewed Issue has recently been reviewed (mid-2020) label Jun 18, 2020
@bladey
Copy link
Contributor

bladey commented Jun 18, 2020

Hi @rcgillet,

Thanks for reporting this issue. It appears this issue is a duplicate of #3335.

There is a PR at to resolve this #3897 which will get merged soon.

If I'm not correct, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet issue/reviewed Issue has recently been reviewed (mid-2020)
Projects
None yet
Development

No branches or pull requests

2 participants