tabindex handling in WCAG aware areas

tabindex handling in WCAG aware areas

phaxphax Posts: 18Questions: 5Answers: 0

Link to test case: none
Debugger code (debug.datatables.net): none
Error messages shown: none
Description of problem:

With version 2.0.5 (and 2.0.8 by only looking at the code) and a Bootstrap 4 UI, the tabindex="0" is emitted even on elements that are already focusable. E.g. for <a> elements this attribute is redundant. Our particular problem area is the "paging area".

Current HTML code:

<li class="dt-paging-button page-item">
<a href="#" class="page-link" aria-controls="faqsupfedgov" 
  data-dt-idx="1" tabindex="0">2</a></li>

Expected HTML code:

<li class="dt-paging-button page-item">
<a href="#" class="page-link" aria-controls="faqsupfedgov"
 data-dt-idx="1">2</a></li>

Thanks for your help in advance :)

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,468 Site admin

    It might be redundant, but does it cause any issues? It is added so the tabindex can be controlled, and rather than checking for 0, I just always add it, thinking that there wouldn't be a problem?

    Allan

  • phaxphax Posts: 18Questions: 5Answers: 0

    Yes it is redundant and was a "recommendation" to fix in the WCAG tests.
    See https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html

    So it's not a showstopper, but a nice-to-have only...

  • allanallan Posts: 63,489Questions: 1Answers: 10,468 Site admin

    Committed that change to my WIP 2.1 branch.

    I'll be merging that to master in the second week of July and hopefully releasing it not too long after.

    Allan

Sign In or Register to comment.