question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
userquincommented, Aug 27, 2021

@sibbng to use on vue2 you need babel, see this comment https://github.com/vueuse/vueuse/issues/551#issuecomment-852023809

0reactions
sibbngcommented, Aug 27, 2021

I managed it to work with that configuration on Vue CLI:

module.exports = {
  transpileDependencies: ['@vueuse/core', '@vueuse/shared']
}

Tried build.transpile option on Nuxt but didn’t help but I’m pretty sure it is doable with another way.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found