put in some code to fix losing focus on the screen name (#679)

This commit is contained in:
Mike Sawka 2024-06-14 17:24:36 -07:00 committed by GitHub
parent 66310e8bfb
commit 936537a03a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,10 +234,21 @@ class Screen {
} }
refocusLine(sdata: ScreenDataType, oldFocusType: string, oldSelectedLine: number): void { refocusLine(sdata: ScreenDataType, oldFocusType: string, oldSelectedLine: number): void {
if (this.globalModel.activeMainView.get() != "session") {
return;
}
let isCmdFocus = sdata.focustype == "cmd"; let isCmdFocus = sdata.focustype == "cmd";
if (!isCmdFocus) { if (!isCmdFocus) {
return; return;
} }
if (document.activeElement != null) {
if (document.activeElement.nodeName == "INPUT" || document.activeElement.nodeName == "TEXTAREA") {
return;
}
}
if (this.globalModel.modalsModel.hasOpenModals()) {
return;
}
let curLineFocus = this.globalModel.getFocusedLine(); let curLineFocus = this.globalModel.getFocusedLine();
let sline: LineType = null; let sline: LineType = null;
if (sdata.selectedline != 0) { if (sdata.selectedline != 0) {