You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Button, IconButton, ToggleButton: holding Enter activates once per key repeat #8944
Holding Enter on a Button, IconButton or ToggleButton activates it once per keyboard auto-repeat. A native <button> fires click on every repeated Enter keydown, and Button doesn't check KeyboardEvent.repeat: its only key handler runs when it is aria-disabled (Button.tsx:711-720), and the click path (Button.tsx:679-705) can't tell a repeat from a press. ToggleButton has no key handling at all.
So a held Enter on a ToggleButton flips it on and off about 30 times a second and leaves it in whichever state the key-up lands on. On a Button with onClick (or an interruptible clickAction) it runs the action many times: adding rows, stepping a counter, sending a message.
Astryx already rejects auto-repeat activation elsewhere: DropdownMenu (DropdownMenu.tsx:1248-1250), ContextMenu (ContextMenu.tsx:527-528) and Table activation (useTableActivation.spec.md FR8: "Keyboard auto-repeat never activates"). React Aria's usePress also ignores repeated key events, so one held key is one press.
Expected: one press per Enter key-down; repeats are ignored (for example, preventDefault() on a keydown with repeat set, for Enter, on the Button family).
Activity
fix(Button, IconButton, ToggleButton): a held Enter key is one press (m…