-
Notifications
You must be signed in to change notification settings - Fork 628
Feat(SelectPanel) remove aria active-descendant pattern in favor of roving tab index under FF #6330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 44 commits
1bf4dae
89fe0b6
8f152bc
98fc899
883181f
925b991
56d790b
2f0182c
5ce1efc
b2f4967
9c548a2
8bec686
6db7ec5
f5b0c09
bb173e1
b9c8dcc
e286689
638594f
ea6017c
008b0b6
1b7de74
1fa934b
59839c6
822c385
22caae0
ae6812a
134fb0f
f79e9cf
1d2891a
fd281f0
ce16567
f504b56
31ae021
c2c8843
3a228d9
b23a28f
c525ce9
73c023a
f5babb1
deb7881
858959e
7c60e82
3dc4d98
1eca2e7
a531bd4
5c7f422
09525c4
57d3032
8aa6272
a36006d
891b39d
41472fc
b55977a
ccfdcce
dc4ccfe
0fbf871
4271f2f
dd82743
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
feat(SelectPanel): remove aria activedescendant and add a roving tab index |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>( | |
const inactive = Boolean(inactiveText) | ||
// TODO change `menuContext` check to ```listRole !== undefined && ['menu', 'listbox'].includes(listRole)``` | ||
// once we have a better way to handle existing usage in dotcom that incorrectly use ActionList.TrailingAction | ||
const menuContext = container === 'ActionMenu' || container === 'SelectPanel' | ||
const menuContext = container === 'ActionMenu' || container === 'SelectPanel' || container === 'FilteredActionList' | ||
// TODO: when we change `menuContext` to check `listRole` instead of `container` | ||
const showInactiveIndicator = inactive && !(listRole !== undefined && ['menu', 'listbox'].includes(listRole)) | ||
|
||
|
@@ -121,6 +121,8 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>( | |
else inferredItemRole = 'menuitem' | ||
} else if (listRole === 'listbox') { | ||
if (selectionVariant !== undefined && !role) inferredItemRole = 'option' | ||
} else if (container && ['SelectPanel', 'FilteredActionList'].includes(container)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this used for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really required. It was in your initial PR but I couldn't really figure out what it was affecting. The prev check for |
||
if (selectionVariant !== undefined && !role) inferredItemRole = 'option' | ||
} | ||
|
||
const itemRole = role || inferredItemRole | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's '
radio
'?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has radio buttons in modal. The type failed when I explicitly sent the prop in
FilteredActionList