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

This commit is contained in:
Joffrey JAFFEUX 2019-05-16 14:37:37 +02:00 committed by GitHub
parent 1afe6d0aee
commit 0c6ebe66ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -132,9 +132,10 @@ WidgetClickHook.setupDocumentCallback = function() {
let node = e.target; let node = e.target;
const $outside = $("[data-click-outside]"); const $outside = $("[data-click-outside]");
$outside.each((i, outNode) => { $outside.each((i, outNode) => {
if (outNode.contains(node)) { if (outNode.contains(node) || outNode.style.position === "absolute") {
return; return;
} }
const widget2 = outNode[CLICK_OUTSIDE_ATTRIBUTE_NAME]; const widget2 = outNode[CLICK_OUTSIDE_ATTRIBUTE_NAME];
if (widget2) { if (widget2) {
widget2.clickOutside(e); widget2.clickOutside(e);