diff --git a/src/public/app/widgets/attribute_widgets/attribute_editor.js b/src/public/app/widgets/attribute_widgets/attribute_editor.js index bbc27fe4f..84fba78b1 100644 --- a/src/public/app/widgets/attribute_widgets/attribute_editor.js +++ b/src/public/app/widgets/attribute_widgets/attribute_editor.js @@ -297,6 +297,12 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget { } async save() { + if (this.lastUpdatedNoteId !== this.noteId) { + // https://github.com/zadam/trilium/issues/3090 + console.warn("Ignoring blur event because a different note is loaded."); + return; + } + const attributes = this.parseAttributes(); if (attributes) { @@ -354,6 +360,8 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget { } dataChanged() { + this.lastUpdatedNoteId = this.noteId; + if (this.lastSavedContent === this.textEditor.getData()) { this.$saveAttributesButton.fadeOut(); }