Skip to content

onMenuOpen triggers on each input #3335

Closed

Description

@kino90

When a select (or creatable) is open, writing triggers onMenuOpen callback on each keystroke.

Demo: https://codesandbox.io/s/k0l8r2z6yr

I think that it should only trigger when opening the menu, right?

Activity

  1. ronjouch commented on Feb 19, 2019

    @ronjouch

    When a select (or creatable) is open, writing triggers onMenuOpen callback on each keystroke.

    Demo: https://codesandbox.io/s/k0l8r2z6yr

    I think that it should only trigger when opening the menu, right?

    I confirm the bug with react-select@2.4.1 in Chrome 72

  2. Bryze commented on Feb 20, 2019

    @Bryze

    Any update on this?

  3. viniciusdacal commented on Jul 11, 2019

    @viniciusdacal

    still on 3.0.4.

    The Select component is calling parent props onMenuOpen.
    I imagine that's because the expected behaviour is that the menu should be always open
    if the user is typing.
    However, we could put a condition in the manger, or in the select, if the menu is already open, there's no reason to fire onMenuOpen again.

  4. lorisdev commented on Jan 7, 2020

    @lorisdev
    Contributor

    Still the same behavior in 3.0.8

    The onMenuOpen callback is triggered within handleInputChange in addition of being triggered already when the Menu actually opens in the openMenu method as is has been mentioned in #3620 as well

  5. added a commit that references this issue on Jan 7, 2020
    539b259
  6. lorisdev commented on Jan 8, 2020

    @lorisdev
    Contributor

    Well just removing the call to onMenuOpen inside handleInputChange breaks some tests ... Looks like the lib is relying on this buggy behaviour for a reason I don't have time to investigate ...
    Thus it may be a breaking change for many users and may require a major new version...

  7. added a commit that references this issue on Feb 26, 2020
    4750e35
  8. lorisdev commented on Feb 26, 2020

    @lorisdev
    Contributor

    pruik found that we should call onMenuOpen inside handleInputChange #3897 (comment)

    The PR now passes all the test 🎉
    He proposed another PR as well which fixes this bug. We may see it fixed soon 🤞

  9. added
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Jun 3, 2020
  10. added
    issue/bug-confirmedIssues about a bug that has been confirmed by a maintainer
    and removed
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Jun 12, 2020
  11. bladey commented on Jun 12, 2020

    @bladey
    Contributor

    PR #3335 in review.

  12. added
    pr/in-reviewPRs currently in review by maintainers for the next release
    issue/reviewedIssue has recently been reviewed (mid-2020)
    and removed
    pr/in-reviewPRs currently in review by maintainers for the next release
    on Jun 12, 2020
  13. added
    issue/has-prIssue has a PR attached to it that may solve the issue
    on Jul 6, 2020
  14. added a commit that references this issue on Aug 27, 2020
    fc7374c
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-confirmedIssues about a bug that has been confirmed by a maintainerissue/has-prIssue has a PR attached to it that may solve the issueissue/reviewedIssue has recently been reviewed (mid-2020)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions