Skip to content

[composite] Fire Space key activation on keydown not keyup #4051

@nattui

Description

@nattui

Bug report

Current behavior

I’ve noticed an inconsistency in keyboard behavior between the Space and Enter/Return keys when interacting with focusable components (e.g., ToggleGroup or Toolbar).

When a component is focused:

  • Pressing Enter (Return) to activate an item, then pressing the Right Arrow key to move to the next item, behaves as expected, the activated state is preserved.
  • However, when pressing Space to activate the same item and then pressing the Right Arrow key, the activation does not appear to be applied. The behavior is as if the Space key activation was ignored.

Expected behavior

Both Space and Enter should activate the focused item consistently, and the activated state should persist when navigating with arrow keys.

Reproducible example

Any one of these components, if you focus and then press space and then arrow keys, the space does not get applied

https://base-ui.com/react/components/accordion
https://base-ui.com/react/components/toggle-group
https://base-ui.com/react/components/toolbar
https://base-ui.com/react/components/navigation-menu
https://base-ui.com/react/components/menubar
https://base-ui.com/react/components/menu

Base UI version

"@base-ui/react": "1.1.0"

Which browser are you using?

Helium https://helium.computer
Chrome
Safari

Which OS are you using?

Mac OS

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions