-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug][Severe] Using Combobox.Input
with displayValue
breaks the input behaviour
#1735
Comments
Combobox.Input
with displayValue
breaks the input behaviourCombobox.Input
with displayValue
breaks the input behaviour
This should be fixed by #1755, and will be available in the next release. You can already try it using:
|
Hey! Thank you for your bug report! Can you explain your problem a bit more because I am confused about what you mean with "after a few ms" and using your stackblitz with 1.6.6 doesn't seem to explain your issue either. I simplified the stackblitz a bit using the latest insiders version: https://stackblitz.com/edit/react-cqexep?file=src/App.js Right now the (expected) behaviour is that if you are typing the contents stays as-is, however if you "cancel" (by clicking outside the Combobox, or pressing escape) then it will reset to whatever the value was. Is this the behaviour that you expected or did you expect something else? |
Hello @RobinMalfait ! EDIT : this issue seems solved now. I've just found a new one though 😅 |
@JesusTheHun awesome that it works now!
Yes and no, typing opens the combobox which is expected behaviour because it then starts filtering. Losing the input focus sounds wrong but it can happen if you render a different input then you rendered before (like a different React tree altogether that was unmounted & re-mounted). You can solve this in 2 ways:
|
Check this : https://stackblitz.com/edit/react-1zmm1p?file=src%2FApp.js |
@JesusTheHun This should be fixed by #2090, and will be available in the next release. You can already try it using I've updated your stackblitz reproduction with the latest insiders build: https://stackblitz.com/edit/react-drzwin |
@RobinMalfait thanks! Any ETA for the next release ? |
@JesusTheHun we are doing a bunch of cleanup this week, so I would say by the end of the week. |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
Bug found in :
0.0.0-insiders.fa10cb0
Works fine with
1.6.6
What browser are you using?
N/A
Reproduction URL
https://stackblitz.com/edit/react-onn88a?file=src/App.js
Describe your issue
Focus the input and start editing its value. You will see after a few ms it will return to the value returned by
displayValue
.Up to
1.6.6
the behaviour was to keep the user input while he's editing.May be related to issue #1675, PR #1679.
The text was updated successfully, but these errors were encountered: