From aed5418366937b7f7cb0ef5a42c9c731506ccec6 Mon Sep 17 00:00:00 2001 From: ajugo Date: Thu, 19 Oct 2023 09:48:20 +0200 Subject: [PATCH] Fix closing item sidebar for printing label modal [SCI-9541] (#6486) --- .../repository_item_sidebar/RepositoryItemSidebar.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue b/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue index fb893eb03..397ea5292 100644 --- a/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue +++ b/app/javascript/vue/repository_item_sidebar/RepositoryItemSidebar.vue @@ -295,11 +295,11 @@ export default { if (!this.isShowing) return const sidebar = this.$refs.wrapper; - // Check if the clicked element is not within the sidebar and it's not another item link or belogs to modal - if (!sidebar.contains(event.target) && - !event.target.closest('a') && - !event.target.closest('.modal')) { - this.toggleShowHideSidebar(null) + // Check if the clicked element is not within the sidebar and it's not another item link or belogs to modals + const selectors = ['a', '.modal', '.label-printing-progress-modal']; + + if (!sidebar.contains(event.target) && !selectors.some(selector => event.target.closest(selector))) { + this.toggleShowHideSidebar(null); } }, toggleShowHideSidebar(repositoryRowUrl, myModuleId = null) {