From 97cc68024680f2b4e699a6ee52589fc45f81f5a1 Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Tue, 25 Oct 2022 14:27:07 -0700 Subject: [PATCH] fix(label): visibily hide label created for screenreaders #119 --- src/auro-select.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/auro-select.js b/src/auro-select.js index f990d2f..bb760fa 100644 --- a/src/auro-select.js +++ b/src/auro-select.js @@ -334,7 +334,18 @@ class AuroSelect extends LitElement { placeholderLabel.setAttribute("id", textId); placeholderLabel.setAttribute("aria-live", "polite"); - placeholderLabel.classList.add("util_displayHiddenVisually"); + + const styles = { + position: 'absolute', + overflow: 'hidden', + clipPath: 'inset(1px, 1px, 1px, 1px)', + width: '1px', + height: '1px', + padding: '0', + border: '0' + }; + + Object.assign(placeholderLabel.style, styles); this.addEventListener('focus', () => { document.body.appendChild(placeholderLabel);