Skip to content

Unexpected call to onMenuClose on input blur. #3876

Closed

Description

@rcgillet

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.

Activity

  1. added
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Jun 1, 2020
  2. bladey commented on Jun 18, 2020

    @bladey
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yetissue/reviewedIssue has recently been reviewed (mid-2020)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions