@@ -688,6 +688,8 @@ export interface IStyleController {
688688
689689export interface IListAccessibilityProvider < T > extends IListViewAccessibilityProvider < T > {
690690 getAriaLabel ( element : T ) : string | null ;
691+ getWidgetAriaLabel ( ) : string ;
692+ getWidgetRole ?( ) : string ;
691693 getAriaLevel ?( element : T ) : number | undefined ;
692694 onDidChangeActiveDescendant ?: Event < void > ;
693695 getActiveDescendantId ?( element : T ) : string | undefined ;
@@ -821,7 +823,6 @@ export interface IListOptions<T> {
821823 readonly keyboardNavigationLabelProvider ?: IKeyboardNavigationLabelProvider < T > ;
822824 readonly keyboardNavigationDelegate ?: IKeyboardNavigationDelegate ;
823825 readonly ariaRole ?: string ;
824- readonly ariaLabel ?: string ;
825826 readonly keyboardSupport ?: boolean ;
826827 readonly multipleSelectionSupport ?: boolean ;
827828 readonly multipleSelectionController ?: IMultipleSelectionController < T > ;
@@ -1106,6 +1107,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
11061107 private styleController : IStyleController ;
11071108 private typeLabelController ?: TypeLabelController < T > ;
11081109 private accessibilityProvider ?: IListAccessibilityProvider < T > ;
1110+ private _ariaLabel : string = '' ;
11091111
11101112 protected readonly disposables = new DisposableStore ( ) ;
11111113
@@ -1250,8 +1252,8 @@ export class List<T> implements ISpliceable<T>, IDisposable {
12501252 this . onDidChangeFocus ( this . _onFocusChange , this , this . disposables ) ;
12511253 this . onDidChangeSelection ( this . _onSelectionChange , this , this . disposables ) ;
12521254
1253- if ( _options . ariaLabel ) {
1254- this . view . domNode . setAttribute ( 'aria-label' , localize ( 'aria list' , "{0}. Use the navigation keys to navigate." , _options . ariaLabel ) ) ;
1255+ if ( this . accessibilityProvider ) {
1256+ this . ariaLabel = this . accessibilityProvider . getWidgetAriaLabel ( ) ;
12551257 }
12561258 if ( _options . multipleSelectionSupport ) {
12571259 this . view . domNode . setAttribute ( 'aria-multiselectable' , 'true' ) ;
@@ -1354,6 +1356,15 @@ export class List<T> implements ISpliceable<T>, IDisposable {
13541356 return this . view . lastVisibleIndex ;
13551357 }
13561358
1359+ get ariaLabel ( ) : string {
1360+ return this . _ariaLabel ;
1361+ }
1362+
1363+ set ariaLabel ( value : string ) {
1364+ this . _ariaLabel = value ;
1365+ this . view . domNode . setAttribute ( 'aria-label' , localize ( 'aria list' , "{0}. Use the navigation keys to navigate." , value ) ) ;
1366+ }
1367+
13571368 domFocus ( ) : void {
13581369 this . view . domNode . focus ( ) ;
13591370 }
0 commit comments