oxidecomputer / oxidecomputer/console
Enter in firewall rule targets/hosts listbox submits full form
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 228
- Forks
- 22
- Avg merge
- 19h 42m
- Merged PRs (30d)
- 32
Description
In #2540 we made it so you don't accidentally submit the entire firewall rule form when you press enter in the target combobox with the intention of submitting that "subform" (a made up concept that haunts me every day). While messing with a combobox in a modal for #2775 it occurred to me that we had done no such treatment for the type listbox, and I quickly confirmed that when you have that field focused and press enter, it submits the entire form. Fortunately this is not very urgent because unlike with the combobox, users are very unlikely to press enter with the type listbox focused, and it's not the end of the world if they do, it's just moderately annoying.
We could of course do a similar hack in listbox and eat enter keypresses when an alternate onEnter is present. There might be a better way where we catch the event before it gets out of the subform. See https://github.com/oxidecomputer/console/issues/2557#issuecomment-2532590308 and #2610 too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked app/ui/lib/Combobox.tsx lines 215-223 and inspect the corresponding listbox implementation and its Enter-key handling. Reproduce the firewall rule form behavior with the type listbox focused, then ensure Enter no longer submits the full form while preserving the intended subform behavior; consider the related discussion in #2557 and #2610.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100