Skip to content

Commit

Permalink
fix: improved accessibility for time display (#8182)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
brayden-wood authored Mar 21, 2023
1 parent fefd525 commit c35c45b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/js/control-bar/time-controls/time-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ class TimeDisplay extends Component {
this.contentEl_ = Dom.createEl('span', {
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)
// 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
// role='presentation' causes VoiceOver to NOT treat this span as a break.
'role': 'presentation'
role: 'presentation'
});

el.appendChild(this.contentEl_);
Expand Down

0 comments on commit c35c45b

Please sign in to comment.