Skip to content

[Bug]: Triggering button's active state with the spacebar is only visible when mouse is hovering #35397

@NewYanko

Description

@NewYanko

Component

Button

Package version

9.72.3

React version

19.1.1

Environment

System:
    OS: macOS 15.6.1
    CPU: (8) arm64 Apple M1
    Memory: 158.72 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 141.0.7390.123
    Safari: 18.6
  npmPackages:
    @fluentui/react-charts: ^9.3.3 => 9.3.3 
    @fluentui/react-components: ^9.72.3 => 9.72.3 
    @types/react: ^19.1.13 => 19.2.2 
    @types/react-dom: ^19.1.9 => 19.2.2 
    react: ^19.1.1 => 19.2.0 
    react-dom: ^19.1.1 => 19.2.0

Current Behavior

When a button is selected with Tab and pressed with Space, the active visual state is only displayed if the cursor is hovering it.

Expected Behavior

The button should display the pressed state when the spacebar is being pressed, independently of the cursor location

Reproduction

https://stackblitz.com/edit/7mofwonc?file=src%2Fexample.tsx

Steps to reproduce

  1. Select the button with Tab
  2. When outlined, press Space while the cursor is not hovering the button
  3. Hover the button and press Space again to see expected behaviour

Are you reporting an Accessibility issue?

None

Suggested severity

Low - Has or doesn't need a workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions