Created
May 22, 2026 00:23
-
-
Save SteveJonesDev/a83f241baf04c97d38e5756f5078ddec to your computer and use it in GitHub Desktop.
Accessibility: Remove tabindex 0 on Flickity sliders
This file contains hidden or 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
| document.addEventListener('DOMContentLoaded', function () { | |
| function removeFlickityTabindex() { | |
| document.querySelectorAll('.flickity-enabled[tabindex="0"]').forEach(function (slider) { | |
| slider.removeAttribute('tabindex'); | |
| }); | |
| } | |
| removeFlickityTabindex(); | |
| const observer = new MutationObserver(removeFlickityTabindex); | |
| observer.observe(document.body, { | |
| childList: true, | |
| subtree: true, | |
| attributes: true, | |
| attributeFilter: ['tabindex', 'class'] | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment