From ee8ac87abbdcfc19c46532d8bbc99933e7479b8d Mon Sep 17 00:00:00 2001 From: Oliver Speir Date: Thu, 11 Apr 2024 01:14:38 -0600 Subject: [PATCH 1/2] fix: a11y-no-noninteractive-tabindex --- .../src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts b/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts index 27da9b011e0d..6d07f36e0ac7 100644 --- a/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts +++ b/packages/astro/src/runtime/client/dev-toolbar/apps/audit/rules/a11y.ts @@ -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; }, }, { From e67f98eaec013df989d0b4aaab98424b0c302d20 Mon Sep 17 00:00:00 2001 From: Oliver Speir Date: Thu, 11 Apr 2024 01:18:21 -0600 Subject: [PATCH 2/2] add changeset --- .changeset/few-mails-kiss.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/few-mails-kiss.md diff --git a/.changeset/few-mails-kiss.md b/.changeset/few-mails-kiss.md new file mode 100644 index 000000000000..6bf4fed23986 --- /dev/null +++ b/.changeset/few-mails-kiss.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes a false positive for "Invalid `tabindex` on non-interactive element" rule for roleless elements ( `div` and `span` ).