File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,19 +313,20 @@ class TextTrackSettings extends ModalDialog {
313313 createElSelect_ ( key , legendId = '' , type = 'label' ) {
314314 const config = selectConfigs [ key ] ;
315315 const id = config . id . replace ( '%s' , this . id_ ) ;
316+ const selectLabelledbyIds = [ legendId , id ] . join ( ' ' ) . trim ( ) ;
316317
317318 return [
318319 `<${ type } id="${ id } " class="${ type === 'label' ? 'vjs-label' : '' } ">` ,
319320 this . localize ( config . label ) ,
320321 `</${ type } >` ,
321- `<select aria-labelledby="${ legendId !== '' ? legendId + ' ' : '' } ${ id } ">`
322+ `<select aria-labelledby="${ selectLabelledbyIds } ">`
322323 ] .
323324 concat ( config . options . map ( o => {
324- const optionId = id + '-' + o [ 1 ] ;
325+ const optionId = id + '-' + o [ 1 ] . replace ( / \W + / g , '' ) ;
325326
326327 return [
327328 `<option id="${ optionId } " value="${ o [ 0 ] } " ` ,
328- `aria-labelledby="${ legendId !== '' ? legendId + ' ' : '' } ${ id } ${ optionId } ">` ,
329+ `aria-labelledby="${ selectLabelledbyIds } ${ optionId } ">` ,
329330 this . localize ( o [ 1 ] ) ,
330331 '</option>'
331332 ] . join ( '' ) ;
You can’t perform that action at this time.
0 commit comments