1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-25 02:42:10 +02:00

fix: improved accessibility for time display (#8182)

This change is to remove the aria-live attribute from time display elements. The aria-live attribute is no longer needed since the presentation role was added. Both attributes being present can lead to unexpected screen reader behavior.
Fixes issue #8143
This commit is contained in:
brayden-wood 2023-03-21 15:55:11 -06:00 committed by GitHub
parent fefd52573e
commit c35c45b03a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,13 +57,11 @@ class TimeDisplay extends Component {
this.contentEl_ = Dom.createEl('span', { this.contentEl_ = Dom.createEl('span', {
className: `${className}-display` className: `${className}-display`
}, { }, {
// tell screen readers not to automatically read the time as it changes
'aria-live': 'off',
// span elements have no implicit role, but some screen readers (notably VoiceOver) // span elements have no implicit role, but some screen readers (notably VoiceOver)
// treat them as a break between items in the DOM when using arrow keys // treat them as a break between items in the DOM when using arrow keys
// (or left-to-right swipes on iOS) to read contents of a page. Using // (or left-to-right swipes on iOS) to read contents of a page. Using
// role='presentation' causes VoiceOver to NOT treat this span as a break. // role='presentation' causes VoiceOver to NOT treat this span as a break.
'role': 'presentation' role: 'presentation'
}); });
el.appendChild(this.contentEl_); el.appendChild(this.contentEl_);