Skip to content

Commit b9c5fc7

Browse files
authored
Merge branch 'master' into tooltip-data
2 parents 3aff875 + fa59676 commit b9c5fc7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/table/table.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,10 @@ export class Table implements AfterViewInit, OnDestroy {
289289

290290
static focus(element: HTMLElement) {
291291
const focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);
292-
if (element.firstElementChild && element.firstElementChild.classList.contains("cds--table-sort") && focusElementList.length > 1) {
293-
focusElementList[1].focus();
294-
} else if (focusElementList.length > 0) {
292+
if (
293+
(element.firstElementChild?.classList.contains("cds--table-sort") && focusElementList.length > 1) ||
294+
focusElementList.length > 0
295+
) {
295296
focusElementList[0].focus();
296297
} else {
297298
element.focus();

0 commit comments

Comments
 (0)