Last active
September 28, 2023 21:56
-
-
Save mayognaise/4cb4f408fe45f91ca3cd6ef51d1c04d6 to your computer and use it in GitHub Desktop.
Set `aria-live` manually here as we cannot use Swiper's navigation since we use custom arrows.
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
/** | |
* Set `aria-live` manually here as we cannot use Swiper's navigation since we use custom arrows. | |
*/ | |
function setAriaLive(el: HTMLDivElement | null, value: string) { | |
if (!el) return; | |
el.innerHTML = ''; | |
setTimeout(() => { | |
el.innerHTML = `<div aria-live="polite" aria-atomic="true" className="visually-hidden">${value}</div>`; | |
}, 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment