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

TypeError: evt.path is undefined #1158

Closed
varunkumar opened this issue Aug 23, 2017 · 5 comments
Closed

TypeError: evt.path is undefined #1158

varunkumar opened this issue Aug 23, 2017 · 5 comments

Comments

@varunkumar
Copy link
Contributor

varunkumar commented Aug 23, 2017

Getting the error when I am trying to sort an element that has shadowRoot. I am using a polyfill for ShadowDOM in Firefox / IE. event.path is not yet available in Firefox / IE.

originalTarget = evt.target.shadowRoot && evt.path[0] || target,

Browsers: Firefox 55 , IE 11

Try this fiddle in Firefox / IE -- http://jsbin.com/cewowicutu/edit?html,js,output

@varunkumar
Copy link
Contributor Author

@RubaXa Please check this.

@RubaXa
Copy link
Collaborator

RubaXa commented Aug 28, 2017

Done, thx.

@varunkumar
Copy link
Contributor Author

Thanks. What is the plan for publishing a new version with the fix?

RubaXa pushed a commit that referenced this issue Aug 28, 2017
@RubaXa
Copy link
Collaborator

RubaXa commented Aug 28, 2017

@Nightbr
Copy link

Nightbr commented Oct 29, 2018

Hey, I reopen this issue because of Firefox 63 which handle Shadow DOM now. The bug is Firefox doesn't handle evt.path because it's not standard. The equivalent is composedPath. I think we should rewrite how we get originalTarget in order to access the handle element in shadowRoot. Here is a fix:

originalTarget = evt.target.shadowRoot && ((evt.path && evt.path[0]) || (evt.composedPath && evt.composedPath()[0])) || target,

See these for more:

We will create a PR soon to fix this.

Thanks in advance for the review and your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants