From cc2dd6fb1133aa25ca4ed1732ff582d08db2e9dd Mon Sep 17 00:00:00 2001 From: Ravi Kumar Date: Sat, 18 Mar 2023 22:55:01 +0530 Subject: [PATCH] fix(table): accessibility fix on checkbox --- src/table/table.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/table/table.component.ts b/src/table/table.component.ts index 29e5ee1d95..fd594e8407 100644 --- a/src/table/table.component.ts +++ b/src/table/table.component.ts @@ -281,7 +281,7 @@ export class Table implements AfterViewInit, OnDestroy { static setTabIndex(element: HTMLElement, index: -1 | 0) { const focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex); - if (element.firstElementChild && element.firstElementChild.classList.contains("bx--table-sort") && focusElementList.length > 0) { + if (element.firstElementChild && element.firstElementChild.classList.contains("bx--table-sort") || focusElementList.length > 0) { focusElementList[0].tabIndex = index; } else { element.tabIndex = index; @@ -290,7 +290,7 @@ export class Table implements AfterViewInit, OnDestroy { static focus(element: HTMLElement) { const focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex); - if (element.firstElementChild && element.firstElementChild.classList.contains("bx--table-sort") && focusElementList.length > 0) { + if (element.firstElementChild && element.firstElementChild.classList.contains("bx--table-sort") || focusElementList.length > 0) { focusElementList[0].focus(); } else { element.focus();