-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improved screenreader experience
- Loading branch information
1 parent
d6cb35d
commit e77e2db
Showing
5 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
!(function (global, document) { | ||
var announceTimer | ||
var $announcer = document.getElementById('a11y-announcer') | ||
var announce = function (message, tone) { | ||
tone = tone || 'polite' | ||
$announcer.setAttribute('aria-live', 'off') | ||
$announcer.innerHTML = '' | ||
clearTimeout(announceTimer) | ||
announceTimer = setTimeout(function () { | ||
$announcer.setAttribute('aria-live', tone) | ||
$announcer.innerHTML = message | ||
}, 500) | ||
} | ||
global.announce = announce | ||
})(window, document) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters