oxidecomputer / console

Oxide Web Console
https://console-preview.oxide.computer
Mozilla Public License 2.0
133 stars 10 forks source link

Combobox: can't click to place cursor, can't type spaces #2483

Open david-crespo opened 3 days ago

david-crespo commented 3 days ago

I think the button is eating the event that should be going to the input. Headless's example doesn't have this problem, so it must be something we're doing.

https://github.com/user-attachments/assets/56e1a199-cac3-4990-8437-639cfc66d1c5

Ok, haha. Turns out we are using ComboboxInput inside of ComboboxButton, but you're only supposed to need one or the other. The styles will need some untangling, but I was able to confirm immediately that changing ComboboxButton to a div does in fact fix clicking to place the cursor and typing spaces.

https://github.com/oxidecomputer/console/blob/e46216aae26609c83e32ff512c1d7a2f055782c2/app/ui/lib/Combobox.tsx#L102-L137