55
66import 'vs/css!./selectBoxCustom' ;
77
8- import * as nls from 'vs/nls' ;
98import { IDisposable , dispose } from 'vs/base/common/lifecycle' ;
109import { Event , Emitter , chain } from 'vs/base/common/event' ;
1110import { KeyCode , KeyCodeUtils } from 'vs/base/common/keyCodes' ;
@@ -50,6 +49,7 @@ class SelectListRenderer implements IRenderer<ISelectOptionItem, ISelectListTemp
5049 data . root = container ;
5150 data . optionText = dom . append ( container , $ ( '.option-text' ) ) ;
5251 data . optionDescriptionText = dom . append ( container , $ ( '.option-text-description' ) ) ;
52+ dom . addClass ( data . optionDescriptionText , 'visually-hidden' ) ;
5353
5454 return data ;
5555 }
@@ -60,18 +60,14 @@ class SelectListRenderer implements IRenderer<ISelectOptionItem, ISelectListTemp
6060 const optionDisabled = ( < ISelectOptionItem > element ) . optionDisabled ;
6161
6262 data . optionText . textContent = optionText ;
63- data . root . setAttribute ( 'aria-label' , nls . localize ( 'selectAriaOption' , "{0}" , optionText ) + ',.' ) ;
6463
6564 if ( typeof element . optionDescriptionText === 'string' ) {
6665 const optionDescriptionId = ( optionText . replace ( / / g, '_' ) . toLowerCase ( ) + '_description_' + data . root . id ) ;
67- data . root . setAttribute ( 'aria-describedby' , optionDescriptionId ) ;
66+ data . optionText . setAttribute ( 'aria-describedby' , optionDescriptionId ) ;
6867 data . optionDescriptionText . id = optionDescriptionId ;
69- data . optionDescriptionText . setAttribute ( 'aria-label' , element . optionDescriptionText ) ;
68+ data . optionDescriptionText . innerText = element . optionDescriptionText ;
7069 }
7170
72- // Workaround for list labels
73- data . root . setAttribute ( 'aria-selected' , 'true' ) ;
74-
7571 // pseudo-select disabled option
7672 if ( optionDisabled ) {
7773 dom . addClass ( ( < HTMLElement > data . root ) , 'option-disabled' ) ;
0 commit comments