question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enforce ARIA rule

See original GitHub issue

DESCRIPTION

We can find slick-slides that have aria-hidden="true" and tabindex="-1" attributes. This breaks the ARIA rules to have any tabindex value (indicating the element is focusable) whilst also having the hidden flag for an element.

Found with ‘Axe’ Chrome extension to flag accessibility issues Docs: https://dequeuniversity.com/rules/axe/3.2/aria-hidden-focus?application=AxeChrome

Replicate here: https://codesandbox.io/s/ppwkk5l6xx

CURRENT:

<div data-index="2" class="slick-slide" tabindex="-1" aria-hidden="true" style="outline: none; width: 430px;"></div>

EXPECTED:

<div data-index="2" class="slick-slide" aria-hidden="true" style="outline: none; width: 430px;"></div>

Solution: tabindex attibute should be removed when aria-hidden="true"

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:25
  • Comments:16

github_iconTop GitHub Comments

11reactions
alldropscommented, Aug 27, 2019

Any updates on this issue? Is someone actively working on this? I’m also experiencing the same problem and the removal of tabindex=“-1” would make life easier

5reactions
agangladacommented, Dec 29, 2020

Hey @diazmaria!

Just fixed the problem externally by adding a hidden attribute to the container of non-active slides.

  1. Hold activeSlide => const [activeSlide, setActiveSlide] = useState(0)
  2. Hook into beforeChange={(_, next) => setActiveSlide(next)} on react-slick
  3. Apply hidden={activeSlide !== i ? true : undefined} on the container of the slide.

Reference: https://web.dev/aria-hidden-focus/#how-to-fix-partially-hidden-focusable-elements

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ARIA - W3C
2.5 Fifth Rule of ARIA Use. All interactive elements must have an accessible name. An interactive element only has an accessible name when...
Read more >
WAI-ARIA basics - Learn web development | MDN
WAI-ARIA Authoring Practices — very detailed design patterns from the W3C, explaining how to implement different types of complex UI control ...
Read more >
Angular ESLint Rules for ARIA - DEV Community ‍ ‍
Enforces using semantic DOM elements over the ARIA role property. This rule prevents content or container elements like <span> or <div> from ...
Read more >
ARIA Made Easy | IT Accessibility - University of Arizona
Rule #1: Don't use ARIA! ... ARIA is intended as a Band-Aid when standard HTML controls and markup cannot be used. Whenever possible...
Read more >
Using CSS to Enforce Accessibility - Adrian Roselli
I am a big proponent of the First Rule of ARIA (don't use ARIA). But ARIA brings a lot to the table that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found