Skip to content

Commit

Permalink
fix(label): visibily hide label created for screenreaders #119
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 committed Oct 31, 2022
1 parent f7c4573 commit 97cc680
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/auro-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 97cc680

Please sign in to comment.