Skip to content

Commit

Permalink
hide announcer text
Browse files Browse the repository at this point in the history
  • Loading branch information
anakaren-rojas committed Dec 11, 2024
1 parent 3ea27e2 commit 7fc22dd
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@ function createAriaLiveRegion(politenessLevel: AriaLivePolitenessLevel): HTMLDiv
const newRegion = document.createElement("div")
newRegion.setAttribute("aria-live", politenessLevel)
newRegion.classList.add("perseus-aria-live-region")
// taken from a11y.srOnly
newRegion.style.border = "0"
newRegion.style.height = "1"
newRegion.style.margin = "-1"
newRegion.style.overflow = "hidden"
newRegion.style.padding = "0"
newRegion.style.position = "absolute"
newRegion.style.width = "1"
return document.body.appendChild(newRegion)
}

0 comments on commit 7fc22dd

Please sign in to comment.