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();