-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yetIssues that describe a bug that hasn't been confirmed by a maintainer yetissue/reviewedIssue has recently been reviewed (mid-2020)Issue has recently been reviewed (mid-2020)
Description
There is a call to onMenuClose
on every input
blur, even when the menu has already been closed from another action.
Steps to reproduce:
- Pass in an
onBlur
andonMenuClose
function to theSelect
component. - Open the menu and make a selection. (
onMenuClose
is fired) - Hit tab or a similar action that would take the focus off of the input. (Both
onBlur
andonMenuClose
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.
lucijafrkovic, dmahnkopf, ZachShaw and amarknath
Metadata
Metadata
Assignees
Labels
issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yetIssues that describe a bug that hasn't been confirmed by a maintainer yetissue/reviewedIssue has recently been reviewed (mid-2020)Issue has recently been reviewed (mid-2020)