Skip to content

Commit

Permalink
perf: 优化键盘快捷键切换tab不能输入命令问题
Browse files Browse the repository at this point in the history
  • Loading branch information
huailei000 committed Dec 22, 2023
1 parent 0e284be commit 84b1f43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/elements/content/content.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ export class ElementContentComponent implements OnInit, OnDestroy {
handleKeyDownTabChange() {
this.keyboardSubscription = fromEvent(window, 'keydown').subscribe((event: any) => {
if (event.altKey && (event.key === 'ArrowRight' || event.key === 'ArrowLeft') && this.viewList.length > 1) {
let timer = null;
window.onblur = () => {
setTimeout(() => window.focus(), 100);
timer = setTimeout(() => window.focus(), 100);
};
let nextViewId: any = 0;
let nextActiveView = null;
Expand All @@ -118,6 +119,7 @@ export class ElementContentComponent implements OnInit, OnDestroy {
}
if (nextActiveView) {
this.setViewActive(nextActiveView);
timer = null;
}
}
});
Expand Down

0 comments on commit 84b1f43

Please sign in to comment.