-
Notifications
You must be signed in to change notification settings - Fork 30k
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
ObjectTree/List: Add ariaRootRole option. Addresses: #65939 #67092
ObjectTree/List: Add ariaRootRole option. Addresses: #65939 #67092
Conversation
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.
@cleidigh Love this PR. I'm glad you convinced me about your authorship of this. I have only minor change requests. Leaving the rest to @roblourens
export interface IListOptions<T> extends IListStyles { | ||
readonly identityProvider?: IIdentityProvider<T>; | ||
readonly dnd?: IListDragAndDrop<T>; | ||
readonly enableKeyboardNavigation?: boolean; | ||
readonly keyboardNavigationLabelProvider?: IKeyboardNavigationLabelProvider<T>; | ||
readonly ariaRootRole?: EListAriaRootRole; |
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.
You can just call it ariaRole
.
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.
👍
src/vs/base/browser/ui/list/list.ts
Outdated
@@ -62,6 +62,12 @@ export interface IIdentityProvider<T> { | |||
getId(element: T): { toString(): string; }; | |||
} | |||
|
|||
// Default tree/list root role 'tree' does not support interactive element labeling, 'form' does | |||
export enum EListAriaRootRole { |
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.
ListAriaRole
would be enough here.
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.
👍
Muito obrigado ;-) @joaomoreno I really enjoy working on this with you guys especially for such a great project ! |
@@ -1292,11 +1287,14 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> { | |||
) { | |||
const treeClass = 'settings-editor-tree'; | |||
|
|||
// Must use role = EListAriaRootRole.FORM for interactive elements in settingsTree |
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.
I think this comment isn't necessary
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.
I'll just merge and delete it :)
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.
Thanks! Looks good to me
Thanks Guys |
Verified in code. |
@joaomoreno
@roblourens
Addresses: #65939
Note:
Reader behavior related to this issue has changed with different versions of readers, Electron
and Chromium. It it appears from testing (both NVDA & Voiceover) that the readers
will ignore the tree related attributes if the root role != 'tree'. I therefore decided
NOT to alter any application logic for those attributes: item role, aria-level, aria-posinset, aria-setsize
I think this is the conservative approach and the minimal amount of changes. I could see
needing to change the item role in the future possibly, but for now works.
Tested: