fix keyboard focus issues (#16206)

This commit is contained in:
Alan Ren
2021-07-16 13:27:15 -07:00
committed by GitHub
parent 3847271e67
commit eed792f3db
19 changed files with 69 additions and 86 deletions

View File

@@ -33,7 +33,6 @@ export interface IPanelOptions {
export interface IPanelView {
render(container: HTMLElement): void;
layout(dimension: DOM.Dimension): void;
focus(): void;
remove?(): void;
onShow?(): void;
onHide?(): void;
@@ -184,15 +183,6 @@ export class TabbedPanel extends Disposable {
let currentIndex = this._tabOrder.findIndex(x => x === tab.tab.identifier);
this.focusNextTab(currentIndex - 1);
}
if (event.equals(KeyCode.Tab)) {
e.preventDefault();
if (this._shownTabId) {
const shownTab = this._tabMap.get(this._shownTabId);
if (shownTab) {
shownTab.tab.view.focus();
}
}
}
}));
const insertBefore = !isUndefinedOrNull(index) ? this.tabList.children.item(index) : undefined;
@@ -401,15 +391,6 @@ export class TabbedPanel extends Disposable {
}
}
public focus(): void {
if (this._shownTabId) {
const tab = this._tabMap.get(this._shownTabId);
if (tab) {
tab.tab.view.focus();
}
}
}
public set collapsed(val: boolean) {
if (val === this._collapsed) {
return;