fix: aria-labelledby attribute has an extra space (#4708)

The aria-labelledby attribute on the fontPercent, edgeStyle, and
fontFamily select options inlcudes an extra space since there is
no ledgendId variable being set on the createElFont_() method. This
fix adds a check to see if the legendId value is set or not inside
the createElSelect_() method. This should keep the extra space
from appearing on the select tags created by the createElFont_()
method.

Fixes #4688
This commit is contained in:
Bo Link
2017-10-31 15:20:15 -04:00
committed by Gary Katsevman
parent a3c254eeb8
commit 855adf35a1
+2 -2
View File
@@ -312,14 +312,14 @@ class TextTrackSettings extends ModalDialog {
`<${type} id="${id}" class="${type === 'label' ? 'vjs-label' : ''}">`,
this.localize(config.label),
`</${type}>`,
`<select aria-labelledby="${legendId} ${id}">`
`<select aria-labelledby="${legendId !== '' ? legendId + ' ' : ''}${id}">`
].
concat(config.options.map(o => {
const optionId = id + '-' + o[1];
return [
`<option id="${optionId}" value="${o[0]}" `,
`aria-labelledby="${legendId} ${id} ${optionId}">`,
`aria-labelledby="${legendId !== '' ? legendId + ' ' : ''}${id} ${optionId}">`,
this.localize(o[1]),
'</option>'
].join('');