Skip to content

Commit 936537a

Browse files
authored
put in some code to fix losing focus on the screen name (#679)
1 parent 66310e8 commit 936537a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/models/screen.ts

+11
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,21 @@ class Screen {
234234
}
235235

236236
refocusLine(sdata: ScreenDataType, oldFocusType: string, oldSelectedLine: number): void {
237+
if (this.globalModel.activeMainView.get() != "session") {
238+
return;
239+
}
237240
let isCmdFocus = sdata.focustype == "cmd";
238241
if (!isCmdFocus) {
239242
return;
240243
}
244+
if (document.activeElement != null) {
245+
if (document.activeElement.nodeName == "INPUT" || document.activeElement.nodeName == "TEXTAREA") {
246+
return;
247+
}
248+
}
249+
if (this.globalModel.modalsModel.hasOpenModals()) {
250+
return;
251+
}
241252
let curLineFocus = this.globalModel.getFocusedLine();
242253
let sline: LineType = null;
243254
if (sdata.selectedline != 0) {

0 commit comments

Comments
 (0)