From 0c16992f5b35f15383aedb7d0f4c7a5f7ea0a561 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Tue, 10 Aug 2021 16:35:46 +0300 Subject: [PATCH] Fixed #1436 - StyleClass does not open overlay when source is clicked again --- src/components/styleclass/StyleClass.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/styleclass/StyleClass.js b/src/components/styleclass/StyleClass.js index 904c529841..2252e5836a 100644 --- a/src/components/styleclass/StyleClass.js +++ b/src/components/styleclass/StyleClass.js @@ -109,6 +109,10 @@ function leave(target, binding) { DomHandler.addClass(target, binding.value.leaveToClass); } } + + if (binding.value.hideOnOutsideClick) { + unbindDocumentListener(target); + } } function resolveTarget(el, binding) { @@ -138,7 +142,6 @@ function bindDocumentListener(target, el, binding) { } else if (!el.isSameNode(event.target) && !el.contains(event.target) && !target.contains(event.target)) { leave(target, binding); - unbindDocumentListener(target); } }