-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
There is probably a race in Headless's handling of the enter keypress in the combobox. This is low-priority because human users can't interact fast enough to hit the race — we only see it in CI because of Playwright.
Claude's proposed solution doesn't work because we actually need that event to bubble and be turned by Headless into a form submission when the combobox list is closed. We are reworking this form at some point, which will probably eliminate the immediate problem, but if there's a bug inside Combobox we're just kicking the can if we don't fix it.
console/app/ui/lib/Combobox.tsx
Lines 215 to 225 in f9854c6
| onKeyDown={(e) => { | |
| // If the caller is using onEnter to override enter behavior, preventDefault | |
| // in order to prevent the containing form from being submitted too. We don't | |
| // need to do this when the combobox is open because that enter keypress is | |
| // already handled internally (selects the highlighted item). So we only do | |
| // this when the combobox is closed. | |
| if (e.key === 'Enter' && onEnter && !open) { | |
| e.preventDefault() | |
| onEnter(e) | |
| } | |
| }} |
Originally posted by @david-crespo in #2941 (comment)
Metadata
Metadata
Assignees
Labels
No labels