Skip to content

Commit 26292d3

Browse files
committed
Update button tab index
1 parent 3b47913 commit 26292d3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/dialog/overflow-menu/overflow-menu-pane.component.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, HostListener, ElementRef } from "@angular/core";
22
import { Dialog } from "../dialog.component";
33
import { position } from "../../utils/position";
4-
import { isFocusInLastItem, isFocusInFirstItem } from "./../../common/tab.service";
4+
import { getFocusElementList, isFocusInLastItem, isFocusInFirstItem } from "./../../common/tab.service";
55
import { I18n } from "./../../i18n/i18n.module";
66

77
/**
@@ -47,13 +47,7 @@ export class OverflowMenuPane extends Dialog {
4747
}
4848

4949
setTimeout(() => {
50-
let options = Array.from<any>(this.dialog.nativeElement.querySelectorAll("*"));
51-
52-
options.forEach(element => {
53-
if (element.tabIndex === 0) {
54-
element.tabIndex = -1;
55-
}
56-
});
50+
getFocusElementList(this.elementRef.nativeElement).every(button => button.tabIndex = -1);
5751
this.listItems()[0].focus();
5852
}, 0);
5953
}

0 commit comments

Comments
 (0)