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
tab-only focusMode replicates the no-tab "Press Enter to focus content" behaviour but it should not (because it's already covered by pressing "tab"), and this in turn disallows applying the "onClick" behaviour to the "Enter key" event (which breaks a11y, because the onClick and "press Enter" behaviours should match).
Actual Behavior
When a card is using focusMode='tab-only' and it has an event handler onKeyDown that handles Enter logic, this logic is not executed. In the example on the repro provided, when the Card is focused, onKeyDown should be executed by pressing Enter, it instead navigates to the action button.
Expected Behavior
The onKeyDown event provided in the Card component should be executed. Example scenario: the card itself might navigate on Enter and tabbing might navigation into, across and out of the Card containers by using focusMode="tab-only".
Logs
No response
Requested priority
Normal
Products/sites affected
Microsoft Loop
Are you willing to submit a PR to fix?
no
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.
The text was updated successfully, but these errors were encountered:
katiearriagam
changed the title
[Bug]: V9 Card: when card is focusable, onKeyDown events set in the props are ignored
[Bug]: V9 Card: when card is focusable (focusMode='tab-only'), onKeyDown events for pressing Enter are not executed
May 31, 2024
Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
yes
Reproduction
https://stackblitz.com/edit/4g3qid?file=src%2Fexample.tsx
Bug Description
tab-only
focusMode replicates theno-tab
"Press Enter to focus content" behaviour but it should not (because it's already covered by pressing "tab"), and this in turn disallows applying the "onClick" behaviour to the "Enter key" event (which breaks a11y, because theonClick
and "press Enter" behaviours should match).Actual Behavior
When a card is using
focusMode='tab-only'
and it has an event handleronKeyDown
that handlesEnter
logic, this logic is not executed. In the example on the repro provided, when theCard
is focused,onKeyDown
should be executed by pressingEnter
, it instead navigates to the action button.Expected Behavior
The
onKeyDown
event provided in theCard
component should be executed. Example scenario: the card itself might navigate onEnter
and tabbing might navigation into, across and out of the Card containers by usingfocusMode="tab-only"
.Logs
No response
Requested priority
Normal
Products/sites affected
Microsoft Loop
Are you willing to submit a PR to fix?
no
Validations
The text was updated successfully, but these errors were encountered: