onClickOutside ie11 Incompatible with composedPath methods
See original GitHub issue/**
- The event bubbling path, compatible ie11, edge, chrome, firefox, safari */
function eventPath(evt: MaybeElementRef): MaybeElementRef[] {
const path = (evt.composedPath && evt.composedPath()) || evt.path,
target = evt.target;
if (path != null) {
return (path.indexOf(window) < 0) ? path.concat(window) : path;
}
if (target === window) {
return [window];
}
function getParents(node: MaybeElementRef, memo?: MaybeElementRef[]): MaybeElementRef[] {
memo = memo || [];
const parentNode = node.parentNode;
if (!parentNode) {
return memo;
} else {
return getParents(parentNode, memo.concat(parentNode));
}
}
return [target].concat(getParents(target), window);
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
seek a solution about the dist of vueuse that is not escaped ...
Hello, antfu! I encountered a problem that I found the dist of vueuse didn't transfrom es6 to es5。So when i installed vueuse in...
Read more >Event.composedPath() - Web APIs - MDN Web Docs
The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be ......
Read more >"composedPath" | Can I use... Support tables for ... - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >event.path is undefined running in Firefox - Stack Overflow
The path property of Event objects is non-standard. The standard equivalent is composedPath , which is a method. But it's new.
Read more >element-plus - UNPKG
/_coreJsData.js';\n\n/** Used to detect methods masquerading as native. ... maps, sets, and weak maps in IE 11 and promises in Node.js < 6....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sibbng to use on vue2 you need babel, see this comment https://github.com/vueuse/vueuse/issues/551#issuecomment-852023809
I managed it to work with that configuration on Vue CLI:
Tried
build.transpile
option on Nuxt but didn’t help but I’m pretty sure it is doable with another way.