[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
inputValueChangedRefto ComboboxInput and a new event typeSIMULATED_CHANGE.When the input triggers onChange, we set
inputValueChangedReftotrueand reset it tofalseafter we detect a controlled value change. When a change is detected, we callCHANGEonly if this value istrue, otherwise we callSIMULATED_CHANGE. This deprecates theINITIAL_CHANGEevent 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:
examplesdirectorysrcdirectory with anindex.tsxentry filestyle.cssfile (if needed by the new package)