From 311b98ffcb64b28908c130818cdb2ed1ddbe5eec Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 30 Oct 2021 15:36:50 +0200 Subject: [PATCH] fix immediately closed attribute detail after clicking e.g. "add label" --- src/public/app/services/context_menu.js | 2 +- src/public/app/widgets/attribute_widgets/attribute_detail.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/context_menu.js b/src/public/app/services/context_menu.js index f1ee8fd48..acbb3a3e4 100644 --- a/src/public/app/services/context_menu.js +++ b/src/public/app/services/context_menu.js @@ -97,7 +97,7 @@ class ContextMenu { .append($link) // important to use mousedown instead of click since the former does not change focus // (especially important for focused text for spell check) - .on('mousedown', (e) => { + .on('mousedown', e => { e.stopPropagation(); this.hide(); diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.js b/src/public/app/widgets/attribute_widgets/attribute_detail.js index ea8f68649..35be1e15b 100644 --- a/src/public/app/widgets/attribute_widgets/attribute_detail.js +++ b/src/public/app/widgets/attribute_widgets/attribute_detail.js @@ -334,7 +334,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget { this.$relatedNotesList = this.$relatedNotesContainer.find('.related-notes-list'); this.$relatedNotesMoreNotes = this.$relatedNotesContainer.find('.related-notes-more-notes'); - $(window).on('mouseup', e => { + $(window).on('mousedown', e => { if (!$(e.target).closest(this.$widget[0]).length && !$(e.target).closest(".algolia-autocomplete").length && !$(e.target).closest("#context-menu-container").length) {