oxidecomputer / oxidecomputer/console

Enter in firewall rule targets/hosts listbox submits full form

Open
#2,784 0 comments 0 reactions 0 assignees View on GitHub

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.

https://github.com/oxidecomputer/console/blob/ab06a337f81df76cd5fcf619089e3bd4d055270c/app/ui/lib/Combobox.tsx?plain=1#L215-L223

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.