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

onMenuOpen triggers on each input #3335

Closed
kino90 opened this issue Jan 9, 2019 · 7 comments · Fixed by #3897
Closed

onMenuOpen triggers on each input #3335

kino90 opened this issue Jan 9, 2019 · 7 comments · Fixed by #3897
Labels
issue/bug-confirmed Issues about a bug that has been confirmed by a maintainer issue/has-pr Issue has a PR attached to it that may solve the issue issue/reviewed Issue has recently been reviewed (mid-2020)

Comments

@kino90
Copy link

kino90 commented Jan 9, 2019

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?

@ronjouch
Copy link

ronjouch commented Feb 19, 2019

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

@Bryze
Copy link

Bryze commented Feb 20, 2019

Any update on this?

@viniciusdacal
Copy link

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.

@lorisdev
Copy link
Contributor

lorisdev commented Jan 7, 2020

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

@lorisdev
Copy link
Contributor

lorisdev commented Jan 8, 2020

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...

pruik pushed a commit to FortesSolutions/react-select that referenced this issue Feb 25, 2020
…selectors on a single page

- Only perform onMenuOpen / onMenuClose if the menu is actually closed / open.
-- Will invalidate PR JedWatson#3897 / Issues JedWatson#3335 JedWatson#3620
lorisdev added a commit to lorisdev/react-select that referenced this issue Feb 26, 2020
@lorisdev
Copy link
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 🤞

@bladey bladey added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Jun 3, 2020
@bladey bladey added issue/bug-confirmed Issues about a bug that has been confirmed by a maintainer and removed issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet labels Jun 12, 2020
@bladey
Copy link
Contributor

bladey commented Jun 12, 2020

PR #3335 in review.

@bladey bladey added pr/in-review PRs currently in review by maintainers for the next release issue/reviewed Issue has recently been reviewed (mid-2020) and removed pr/in-review PRs currently in review by maintainers for the next release labels Jun 12, 2020
@bladey bladey added the issue/has-pr Issue has a PR attached to it that may solve the issue label Jul 6, 2020
JedWatson added a commit that referenced this issue Aug 27, 2020
Fixes #3335 - removes the call to onMenuOpen within handleInputChange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-confirmed Issues about a bug that has been confirmed by a maintainer issue/has-pr Issue has a PR attached to it that may solve the issue issue/reviewed Issue has recently been reviewed (mid-2020)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants