@@ -374,9 +374,10 @@ class QuickInput extends Disposable implements IQuickInput {
374374
375375class QuickPick < T extends IQuickPickItem > extends QuickInput implements IQuickPick < T > {
376376
377- private static readonly INPUT_BOX_ARIA_LABEL = localize ( 'quickInputBox.ariaLabel' , "Type to narrow down results." ) ;
377+ private static readonly DEFAULT_ARIA_LABEL = localize ( 'quickInputBox.ariaLabel' , "Type to narrow down results." ) ;
378378
379379 private _value = '' ;
380+ private _ariaLabel = QuickPick . DEFAULT_ARIA_LABEL ;
380381 private _placeholder : string | undefined ;
381382 private readonly onDidChangeValueEmitter = this . _register ( new Emitter < string > ( ) ) ;
382383 private readonly onDidAcceptEmitter = this . _register ( new Emitter < void > ( ) ) ;
@@ -419,6 +420,15 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
419420
420421 filterValue = ( value : string ) => value ;
421422
423+ set ariaLabel ( ariaLabel : string ) {
424+ this . _ariaLabel = ariaLabel || QuickPick . DEFAULT_ARIA_LABEL ;
425+ this . update ( ) ;
426+ }
427+
428+ get ariaLabel ( ) {
429+ return this . _ariaLabel ;
430+ }
431+
422432 get placeholder ( ) {
423433 return this . _placeholder ;
424434 }
@@ -775,6 +785,9 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
775785 if ( this . ui . inputBox . placeholder !== ( this . placeholder || '' ) ) {
776786 this . ui . inputBox . placeholder = ( this . placeholder || '' ) ;
777787 }
788+ if ( this . ui . inputBox . ariaLabel !== this . ariaLabel ) {
789+ this . ui . inputBox . ariaLabel = this . ariaLabel ;
790+ }
778791 if ( this . itemsUpdated ) {
779792 this . itemsUpdated = false ;
780793 this . ui . list . setElements ( this . items ) ;
@@ -825,7 +838,6 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
825838 this . ui . list . matchOnLabel = this . matchOnLabel ;
826839 this . ui . list . sortByLabel = this . sortByLabel ;
827840 this . ui . setComboboxAccessibility ( true ) ;
828- this . ui . inputBox . setAttribute ( 'aria-label' , QuickPick . INPUT_BOX_ARIA_LABEL ) ;
829841 }
830842}
831843
@@ -1383,7 +1395,7 @@ export class QuickInputController extends Disposable {
13831395 ui . list . sortByLabel = true ;
13841396 ui . ignoreFocusOut = false ;
13851397 this . setComboboxAccessibility ( false ) ;
1386- ui . inputBox . removeAttribute ( 'aria-label' ) ;
1398+ ui . inputBox . ariaLabel = '' ;
13871399
13881400 const backKeybindingLabel = this . options . backKeybindingLabel ( ) ;
13891401 backButton . tooltip = backKeybindingLabel ? localize ( 'quickInput.backWithKeybinding' , "Back ({0})" , backKeybindingLabel ) : localize ( 'quickInput.back' , "Back" ) ;
0 commit comments