Open blovato opened 1 year ago
Hi! Is there something we can fix in useCombobox
for this issue? And if so, can you create a PR? Thank you!
Still exists in v7. Here's the reproduce codesandbox https://codesandbox.io/s/quizzical-williamson-c8tsyg?file=/src/hooks/useCombobox/basic-usage.js
To help finding the cause, I wrote a similar controlled input https://codesandbox.io/s/focused-poincare-zpky86?file=/src/App.js
Also, related https://github.com/downshift-js/downshift/issues/1108 Just don't use the onInputValueChange https://github.com/downshift-js/downshift/issues/1108#issuecomment-842407759
Having the same issue here. Not a clean solution at all, but for now overriding the onChange
input prop and controlling this value with useState fixes it.
downshift
version: 6.1.12node
version: 14.19.0yarn
version: 1.22.17Relevant code or config
What you did: When entering Japanese (or any IME language) into a combobox that controls inputValue, IME composition fails. This first screenshot renders a dropdown with
inputValue
controlled. I clicked the input to focus it and then typed "j" + "a".What happened: The IME editor failed to open to further compose the characters before committing them. What I should have saw would have been this:
Additionally, it appears that the
compositionend
event is never fired when inputValue is controlled.Problem description: When useCombobox is controlling
inputValue
and updating it withonInputValueChange
, IME composition exits before showing the composition editor.Suggested solution: Wrap getInputProps's onChange handler with the spirit of the following: