Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: class array indexOf error #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/vue-clickaway.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function bind(el, binding, vnode) {
// to the top.
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
if (initialMacrotaskEnded && (path ? [].indexOf.call(path, el) < 0 : !el.contains(ev.target))) {
return callback.call(vm, ev);
}
};
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-clickaway.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
}, 0);

el[HANDLER] = function(ev) {
// @NOTE: this test used to be just `el.contains`, but working with path is better,
// @NOTE: this test used to be just `el.containts`, but working with 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
// to the top.
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
if (initialMacrotaskEnded && (path ? [].indexOf.call(path, el) < 0 : !el.contains(ev.target))) {
return callback.call(vm, ev);
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-clickaway.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function bind(el, binding, vnode) {
// to the top.
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
if (initialMacrotaskEnded && (path ? [].indexOf.call(path, el) < 0 : !el.contains(ev.target))) {
return callback.call(vm, ev);
}
};
Expand Down