Permalink
Browse files

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
  • Loading branch information...
knilob authored and gkatsev committed Oct 31, 2017
1 parent a3c254e commit 855adf35a1757fece522ee64ce2709e16a481e5d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/js/tracks/text-track-settings.js
@@ -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('');

0 comments on commit 855adf3

Please sign in to comment.