From 7fc22ddcceb030dfae3ca90dd95409c36eec68ed Mon Sep 17 00:00:00 2001 From: Anakaren Rojas Date: Wed, 11 Dec 2024 09:55:37 -0800 Subject: [PATCH] hide announcer text --- .../src/widgets/interactive-graphs/ariaLiveAnnounce.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/perseus/src/widgets/interactive-graphs/ariaLiveAnnounce.ts b/packages/perseus/src/widgets/interactive-graphs/ariaLiveAnnounce.ts index f8883e2be1..36fb5c4650 100644 --- a/packages/perseus/src/widgets/interactive-graphs/ariaLiveAnnounce.ts +++ b/packages/perseus/src/widgets/interactive-graphs/ariaLiveAnnounce.ts @@ -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) }