mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix orphan note autocomplete, closes #569
This commit is contained in:
parent
3f241553aa
commit
1b831f94a9
8
libraries/autocomplete.jquery.min.js
vendored
8
libraries/autocomplete.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@ -401,11 +401,14 @@ tabRow.addListener('activeTabChange', async ({ detail }) => {
|
||||
tabRow.addListener('tabRemove', async ({ detail }) => {
|
||||
const tabId = detail.tabEl.getAttribute('data-tab-id');
|
||||
|
||||
const tabContentToDelete = tabContexts.find(nc => nc.tabId === tabId);
|
||||
const tabContextToDelete = tabContexts.find(nc => nc.tabId === tabId);
|
||||
|
||||
if (tabContentToDelete) {
|
||||
await tabContentToDelete.saveNoteIfChanged();
|
||||
tabContentToDelete.$tabContent.remove();
|
||||
if (tabContextToDelete) {
|
||||
// sometimes there are orphan autocompletes after closing the tab
|
||||
tabContextToDelete.$tabContent.find('.aa-input').autocomplete('close');
|
||||
|
||||
await tabContextToDelete.saveNoteIfChanged();
|
||||
tabContextToDelete.$tabContent.remove();
|
||||
}
|
||||
|
||||
tabContexts = tabContexts.filter(nc => nc.tabId !== tabId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user