Skip to content

Commit

Permalink
Update a11y-no-noninteractive-tabindex rule for dev tool bar (withast…
Browse files Browse the repository at this point in the history
…ro#10750)

* fix: a11y-no-noninteractive-tabindex

* add changeset
  • Loading branch information
OliverSpeir authored and PeterDraex committed Apr 23, 2024
1 parent 5e9b61b commit 02477b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/few-mails-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fixes a false positive for "Invalid `tabindex` on non-interactive element" rule for roleless elements ( `div` and `span` ).
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,11 @@ export const a11y: AuditRuleWithSelector[] = [

if (!isInteractive(element)) return false;

if (!interactiveElements.includes(element.localName)) return true;
if (
!interactiveElements.includes(element.localName) &&
!roleless_elements.includes(element.localName)
)
return true;
},
},
{
Expand Down

0 comments on commit 02477b8

Please sign in to comment.