Skip to content

Commit

Permalink
fix: aria-labelledby attribute has an extra space
Browse files Browse the repository at this point in the history
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 videojs#4688
  • Loading branch information
knilob committed Oct 31, 2017
1 parent 93e7670 commit 24ccb4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/tracks/text-track-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand Down

0 comments on commit 24ccb4a

Please sign in to comment.