From 053c544b8ce801127d06f46a7584301095268061 Mon Sep 17 00:00:00 2001 From: Mike Byrne Date: Mon, 6 Jan 2025 16:50:55 +0000 Subject: [PATCH] momentarily halt close of dropdowns to allow clicks inside and importantly, whilst allowing the dropdown to autoclose --- frontend/js/components/Dropdown.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/js/components/Dropdown.vue b/frontend/js/components/Dropdown.vue index 8f96c0e70..1af639054 100755 --- a/frontend/js/components/Dropdown.vue +++ b/frontend/js/components/Dropdown.vue @@ -172,8 +172,13 @@ } } - if (!this.clickable) this.close() - else if (!this.$el.querySelector('[data-dropdown-content]').contains(target) && this.clickable) this.close() + // timeout so the click is not triggered directly + this.timer = setTimeout(() => { + this.timer = null + + if (!this.clickable) this.close() + else if (!this.$el.querySelector('[data-dropdown-content]').contains(target) && this.clickable) this.close() + }, 1) }, open: function (onShow) { if (this.active) return