Fix input clean error

This commit is contained in:
2022-03-07 20:29:42 +08:00
parent f3ba3b6150
commit 0e1aa51d4b
4 changed files with 45 additions and 17 deletions
+9 -5
View File
@@ -74,7 +74,7 @@ class Layout extends Emitter<ILayoutEvent> {
}
public focus = (panelId: string) => {
if (panelId === "") {
if (panelId === "" && this.focusId !== "") {
this.focusId = panelId;
this.emit("switchTab", this);
}
@@ -89,10 +89,14 @@ class Layout extends Emitter<ILayoutEvent> {
}
}
if (index >= 0) {
layout.focusPanel = panelId;
this.focusId = panelId;
this.emit("switchTab", this);
return true;
if (layout.focusPanel === panelId && this.focusId === panelId) {
return true;
} else {
layout.focusPanel = panelId;
this.focusId = panelId;
this.emit("switchTab", this);
return true;
}
}
}
})