Enter and Space can't press a focused button #322

Closed
opened 2026-10-23 22:39:51 +00:00 by littlefox · 1 comment
Owner

Found while testing #315: the global keys take Enter and Space (the default action, "Läs nästa") even when a button has keyboard focus, so keyboard users can't press "Visa äldre", "Ångra" or any other button with Enter or Space.

Fix: when the focused control was reached with the keyboard (:focus-visible), Enter and Space go to it. After a mouse click a button keeps focus, but it isn't focus-visible, so space still reads on as before.

Found while testing #315: the global keys take Enter and Space (the default action, "Läs nästa") even when a button has keyboard focus, so keyboard users can't press "Visa äldre", "Ångra" or any other button with Enter or Space. Fix: when the focused control was reached with the keyboard (`:focus-visible`), Enter and Space go to it. After a mouse click a button keeps focus, but it isn't focus-visible, so space still reads on as before.
littlefox added this to the 0.7: Threads milestone 2026-10-23 22:39:51 +00:00
Author
Owner

Fixed in #325; main green (ci #586).

  • A control reached with Tab keeps its own Enter and Space. The one last pressed with a pointer gives them back to reading, so Space after a click still reads on. This is tracked from pointerdown: the first try used :focus-visible, and Chromium counts a clicked button as keyboard-focused once any key has been pressed, so Space pressed the button just clicked (charset and settle specs caught it).
  • keys.spec.ts: Tab to Inkorg, then Enter, opens the inbox and reads nothing. It fails without the fix.
  • Full suite passes, including charset/settle/reading/commands.
Fixed in #325; main green (ci #586). - A control reached with Tab keeps its own Enter and Space. The one last pressed with a pointer gives them back to reading, so Space after a click still reads on. This is tracked from `pointerdown`: the first try used `:focus-visible`, and Chromium counts a clicked button as keyboard-focused once any key has been pressed, so Space pressed the button just clicked (charset and settle specs caught it). - `keys.spec.ts`: Tab to Inkorg, then Enter, opens the inbox and reads nothing. It fails without the fix. - Full suite passes, including charset/settle/reading/commands.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
littlefox/neokom#322
No description provided.