From b8cd03d2e2713ffe648923712d2599b25808ad67 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Thu, 17 Oct 2024 19:05:03 +0200 Subject: [PATCH] Tabs: override tablist's tabindex only when necessary (#66209) Co-authored-by: ciampo Co-authored-by: tyxla --- packages/components/CHANGELOG.md | 1 + packages/components/src/tabs/tablist.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 475bf272cc1bb..53ff933848338 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -8,6 +8,7 @@ - `ColorPalette`: prevent overflow of custom color button background ([#66152](https://github.com/WordPress/gutenberg/pull/66152)). - `RadioGroup`: Fix arrow key navigation in RTL ([#66202](https://github.com/WordPress/gutenberg/pull/66202)). - `Tabs` and `TabPanel`: Fix arrow key navigation in RTL ([#66201](https://github.com/WordPress/gutenberg/pull/66201)). +- `Tabs`: override tablist's tabindex only when necessary ([#66209](https://github.com/WordPress/gutenberg/pull/66209)). ### Enhancements diff --git a/packages/components/src/tabs/tablist.tsx b/packages/components/src/tabs/tablist.tsx index 46cc0488bc67a..998da5707aa07 100644 --- a/packages/components/src/tabs/tablist.tsx +++ b/packages/components/src/tabs/tablist.tsx @@ -111,8 +111,15 @@ export const TabList = forwardRef< ( +
+ ) } onBlur={ onBlur } - tabIndex={ -1 } data-select-on-move={ selectOnMove ? 'true' : 'false' } { ...otherProps } className={ clsx(