Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix broken autocomplete in attribute editor, closes #2295
zadam126f41ae5e3f
diff --git a/src/public/app/widgets/attribute_widgets/attribute_editor.js b/src/public/app/widgets/attribute_widgets/attribute_editor.jsindex f06d49c8fa..433b4005a0 100644--- a/src/public/app/widgets/attribute_widgets/attribute_editor.js+++ b/src/public/app/widgets/attribute_widgets/attribute_editor.js@@ -193,7 +193,8 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {this.$editor.on('keydown', async e => {if (e.which === 13) {- await this.save();+ // allow autocomplete to fill the result textarea+ setTimeout(() => this.save(), 100);}this.attributeDetailWidget.hide();diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.jsindex de2fa37ed4..a814957a4f 100644--- a/src/public/app/widgets/containers/ribbon_container.js+++ b/src/public/app/widgets/containers/ribbon_container.js@@ -167,7 +167,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {});}- toggleRibbonTab($ribbonTitle) {+ toggleRibbonTab($ribbonTitle, refreshActiveTab = true) {const activate = !$ribbonTitle.hasClass("active");this.$tabContainer.find('.ribbon-tab-title').removeClass("active");@@ -183,7 +183,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {const activeChild = this.getActiveRibbonWidget();- if (activeChild) {+ if (activeChild && refreshActiveTab) {activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});}} else {@@ -249,7 +249,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {}if ($ribbonTabToActivate) {- $ribbonTabToActivate.trigger('click');+ this.toggleRibbonTab($ribbonTabToActivate, false);}else {this.$bodyContainer.find('.ribbon-body').removeClass("active");