FIX: better node check for clickoutside in widgets (#7573)

FIX: better node check for clickoutside in widgets (#7573)

diff --git a/app/assets/javascripts/discourse/widgets/hooks.js.es6 b/app/assets/javascripts/discourse/widgets/hooks.js.es6
index 21779ee..d4796d5 100644
--- a/app/assets/javascripts/discourse/widgets/hooks.js.es6
+++ b/app/assets/javascripts/discourse/widgets/hooks.js.es6
@@ -132,7 +132,10 @@ WidgetClickHook.setupDocumentCallback = function() {
     let node = e.target;
     const $outside = $("[data-click-outside]");
     $outside.each((i, outNode) => {
-      if (outNode.contains(node) || outNode.style.position === "absolute") {
+      if (
+        outNode.contains(node) ||
+        (outNode === node && outNode.style.position === "absolute")
+      ) {
         return;
       }

GitHub sha: 9bbf4211

1 Like