Skip to content

Build your personal knowledge base with Trilium Notes

fix hiding autocompletes after closing tab, closes #1034

zadam3db84daf94d0
diff --git a/src/public/app/services/tab_manager.js b/src/public/app/services/tab_manager.js
index 5463e295c7..40f29f8c9e 100644
--- a/src/public/app/services/tab_manager.js
+++ b/src/public/app/services/tab_manager.js
@@ -238,7 +238,7 @@ export default class TabManager extends Component {
}
this.tabsUpdate.scheduleUpdate();
-
+
this.setCurrentNotePathToHash();
}
@@ -249,6 +249,9 @@ export default class TabManager extends Component {
return;
}
+ // close dangling autocompletes after closing the tab
+ $(".aa-input").autocomplete("close");
+
await this.triggerEvent('beforeTabRemove', {tabId});
if (this.tabContexts.length <= 1) {
@@ -267,9 +270,6 @@ export default class TabManager extends Component {
this.children = this.children.filter(tc => tc.tabId !== tabId);
- // remove dangling autocompletes after closing the tab
- $(".algolia-autocomplete").remove();
-
this.triggerEvent('tabRemoved', {tabId});
this.tabsUpdate.scheduleUpdate();
@@ -346,4 +346,4 @@ export default class TabManager extends Component {
}
}
}
-}
\ No newline at end of file
+}