From f40a6cb933e397a7802ac366a4cc570dd713683d Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Tue, 13 Oct 2026 20:32:31 +0100 Subject: [PATCH] fix(tab-button): restore keyboard focus --- core/src/components/tab-button/tab-button.tsx | 2 +- .../tab-button/test/a11y/index.html | 5 +++ .../tab-button/test/tab-button.spec.ts | 43 +++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 core/src/components/tab-button/test/tab-button.spec.ts diff --git a/core/src/components/tab-button/tab-button.tsx b/core/src/components/tab-button/tab-button.tsx index 7babc4573b5..4a2f7d11a41 100644 --- a/core/src/components/tab-button/tab-button.tsx +++ b/core/src/components/tab-button/tab-button.tsx @@ -172,7 +172,7 @@ export class TabButton implements ComponentInterface, AnchorInterface { role="tab" aria-selected={selected ? 'true' : null} aria-disabled={disabled ? 'true' : null} - tabindex={disabled ? '-1' : undefined} + tabindex={disabled ? '-1' : href === undefined || href === null ? '0' : undefined} {...inheritedAttributes} > diff --git a/core/src/components/tab-button/test/a11y/index.html b/core/src/components/tab-button/test/a11y/index.html index 1b0d809de01..0416575b2d1 100644 --- a/core/src/components/tab-button/test/a11y/index.html +++ b/core/src/components/tab-button/test/a11y/index.html @@ -32,6 +32,11 @@

Tab Button

+ + Search + + +