EXPERIMENTAL: clicks outside seem unreliable with absolute nodes (#7557)

EXPERIMENTAL: clicks outside seem unreliable with absolute nodes (#7557)

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

GitHub sha: 0c6ebe66

1 Like