make sure autocomplete is closed when navigating to note

This commit is contained in:
zadam 2019-06-26 21:08:54 +02:00
parent 7c77ae758b
commit a3951f1cce
2 changed files with 7 additions and 1 deletions

View File

@ -405,7 +405,7 @@ tabRow.addListener('tabRemove', async ({ detail }) => {
if (tabContextToDelete) {
// sometimes there are orphan autocompletes after closing the tab
tabContextToDelete.$tabContent.find('.aa-input').autocomplete('close');
tabContextToDelete.closeAutocomplete();
await tabContextToDelete.saveNoteIfChanged();
tabContextToDelete.$tabContent.remove();

View File

@ -109,6 +109,8 @@ class TabContext {
this.setTitleBar();
this.closeAutocomplete(); // esp. on windows autocomplete is not getting closed automatically
setTimeout(async () => {
// we include the note into recent list only if the user stayed on the note at least 5 seconds
if (notePath && notePath === this.notePath) {
@ -334,6 +336,10 @@ class TabContext {
}
}
}
closeAutocomplete() {
this.$tabContent.find('.aa-input').autocomplete('close');
}
}
export default TabContext;