-
Notifications
You must be signed in to change notification settings - Fork 562
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
[combobox] Fix binding value undesirely expands combobox #783
[combobox] Fix binding value undesirely expands combobox #783
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 3112a81:
|
Really looking forward to this fix. I have a component that allows selecting named colours as well as using a colour picker. Every time the colour picker updates the combobox input the entire list of colours pops up - not exactly the behaviour one would expect. Any updates on this PR? |
@adalinesimonian Same, I'm wondering how long it typically takes for a PR to be reviewed and merged? We have a similar issue where setting the value dynamically automatically expands the combobox when we don't need/want it to |
We understand why this might be necessary, but this library does not currently have full-time support, and we want to consider the API and issues with #755 a bit more before merging. Keep in mind that you can always patch this behavior in the mean time if you'd like with https://www.npmjs.com/package/patch-package |
Would it be correct to assume that the Basically I'm only calling |
This looks great, thanks @dlacaille! Added a test and updated the storybook index since we updated some of that stuff internally since this PR was created. |
This PR introduced regression in some cases where the popover doesn't open until the user presses the down or up key after initial input. See #755 for the related issue.
Closes #755
This pull request fixes an issue where binding a controlled value undesirely expands combobox.
The change adds
inputValueChangedRef
to ComboboxInput and a new event typeSIMULATED_CHANGE
.When the input triggers onChange, we set
inputValueChangedRef
totrue
and reset it tofalse
after we detect a controlled value change. When a change is detected, we callCHANGE
only if this value istrue
, otherwise we callSIMULATED_CHANGE
. This deprecates theINITIAL_CHANGE
event type as it becomes aSIMULATED_CHANGE
.Thank you for contributing to Reach UI! Please
fill in this template before submitting your PR to help us process your request more quickly.
yarn test
).yarn start
).This pull request:
If creating a new package:
examples
directorysrc
directory with anindex.tsx
entry filestyle.css
file (if needed by the new package)