We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3c081a commit 2374403Copy full SHA for 2374403
index.js
@@ -41,9 +41,11 @@ function bind(el, binding) {
41
}, 0);
42
43
el[HANDLER] = function(ev) {
44
- // @NOTE: IE 5.0+
45
- // @REFERENCE: https://developer.mozilla.org/en/docs/Web/API/Node/contains
46
- if (initialMacrotaskEnded && !el.contains(ev.target)) {
+ // @NOTE: this test used to be `el.containts`, but `ev.path` is better,
+ // because it tests whether the element was there at the time of
+ // the click, not whether it is there now, that the event has arrived
47
+ // to the top.
48
+ if (initialMacrotaskEnded && ev.path.indexOf(el) < 0) {
49
return callback(ev);
50
}
51
};
0 commit comments