fix broken autocomplete in attribute editor, closes #2295

This commit is contained in:
zadam 2021-10-30 15:22:20 +02:00
parent 4b1678c416
commit 126f41ae5e
2 changed files with 5 additions and 4 deletions

View File

@ -193,7 +193,8 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
this.$editor.on('keydown', async e => { this.$editor.on('keydown', async e => {
if (e.which === 13) { if (e.which === 13) {
await this.save(); // allow autocomplete to fill the result textarea
setTimeout(() => this.save(), 100);
} }
this.attributeDetailWidget.hide(); this.attributeDetailWidget.hide();

View File

@ -167,7 +167,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
}); });
} }
toggleRibbonTab($ribbonTitle) { toggleRibbonTab($ribbonTitle, refreshActiveTab = true) {
const activate = !$ribbonTitle.hasClass("active"); const activate = !$ribbonTitle.hasClass("active");
this.$tabContainer.find('.ribbon-tab-title').removeClass("active"); this.$tabContainer.find('.ribbon-tab-title').removeClass("active");
@ -183,7 +183,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
const activeChild = this.getActiveRibbonWidget(); const activeChild = this.getActiveRibbonWidget();
if (activeChild) { if (activeChild && refreshActiveTab) {
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath}); activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
} }
} else { } else {
@ -249,7 +249,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
} }
if ($ribbonTabToActivate) { if ($ribbonTabToActivate) {
$ribbonTabToActivate.trigger('click'); this.toggleRibbonTab($ribbonTabToActivate, false);
} }
else { else {
this.$bodyContainer.find('.ribbon-body').removeClass("active"); this.$bodyContainer.find('.ribbon-body').removeClass("active");