mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
This commit is contained in:
parent
b1b9e42e2c
commit
c6ffb611be
|
@ -822,7 +822,7 @@ export interface IListOptions<T> extends IListStyles {
|
|||
readonly automaticKeyboardNavigation?: boolean;
|
||||
readonly keyboardNavigationLabelProvider?: IKeyboardNavigationLabelProvider<T>;
|
||||
readonly keyboardNavigationDelegate?: IKeyboardNavigationDelegate;
|
||||
readonly ariaRole?: ListAriaRootRole;
|
||||
readonly ariaRole?: ListAriaRootRole | string;
|
||||
readonly ariaLabel?: string;
|
||||
readonly keyboardSupport?: boolean;
|
||||
readonly multipleSelectionSupport?: boolean;
|
||||
|
@ -1198,11 +1198,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
|||
|
||||
this.view = new ListView(container, virtualDelegate, renderers, viewOptions);
|
||||
|
||||
if (typeof _options.ariaRole !== 'string') {
|
||||
this.view.domNode.setAttribute('role', ListAriaRootRole.TREE);
|
||||
} else {
|
||||
this.view.domNode.setAttribute('role', _options.ariaRole);
|
||||
}
|
||||
this.updateAriaRole();
|
||||
|
||||
this.styleElement = DOM.createStyleSheet(this.view.domNode);
|
||||
|
||||
|
@ -1612,10 +1608,19 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
|||
this.view.domNode.removeAttribute('aria-activedescendant');
|
||||
}
|
||||
|
||||
this.view.domNode.setAttribute('role', 'tree');
|
||||
this.updateAriaRole();
|
||||
|
||||
DOM.toggleClass(this.view.domNode, 'element-focused', focus.length > 0);
|
||||
}
|
||||
|
||||
private updateAriaRole(): void {
|
||||
if (typeof this.options.ariaRole !== 'string') {
|
||||
this.view.domNode.setAttribute('role', ListAriaRootRole.TREE);
|
||||
} else {
|
||||
this.view.domNode.setAttribute('role', this.options.ariaRole);
|
||||
}
|
||||
}
|
||||
|
||||
private _onSelectionChange(): void {
|
||||
const selection = this.selection.get();
|
||||
|
||||
|
|
|
@ -164,6 +164,7 @@ export class NotificationsToasts extends Themable {
|
|||
|
||||
// Create toast with item and show
|
||||
const notificationList = this.instantiationService.createInstance(NotificationsList, notificationToast, {
|
||||
ariaRole: 'dialog', // https://github.com/microsoft/vscode/issues/82728
|
||||
ariaLabel: localize('notificationsToast', "Notification Toast"),
|
||||
verticalScrollMode: ScrollbarVisibility.Hidden
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue