From 30fbe560623d91348ddc831affa047385eb6c08a Mon Sep 17 00:00:00 2001 From: Bashamega Date: Fri, 11 Oct 2024 19:00:57 +0300 Subject: [PATCH 1/3] fix(.\components\tablist\tab-list.tsx): fixes a11y rule "interactive-supports-focus" warning The changes include adding tabIndex={0} to elements with role="tab" to ensure they are focusable for keyboard navigation, addressing the accessibility warning (jsx-a11y/interactive-supports-focus). Additionally, an onKeyDown handler was introduced to allow keyboard interaction, enabling users to select tabs using the Enter or Space keys. These changes improve both accessibility and user experience by making the tabs keyboard-accessible. fixes #4138 --- components/TabList/tab-list.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/TabList/tab-list.tsx b/components/TabList/tab-list.tsx index 46b0017a31..afb6f86ea1 100644 --- a/components/TabList/tab-list.tsx +++ b/components/TabList/tab-list.tsx @@ -1,5 +1,4 @@ import React from "react"; - import { useRouter } from "next/router"; import Link from "next/link"; import clsx from "clsx"; @@ -25,6 +24,7 @@ interface SubTabsListProps extends TabListProps { const TabList = ({ tabList, pageId, selectedTab }: TabListProps) => { const router = useRouter(); const range = router.query.range ? Number(router.query.range) : 30; + return (