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

composedPath() broken for tap event on touch devices #4670

Closed
3 tasks done
Saulis opened this issue Jun 6, 2017 · 1 comment
Closed
3 tasks done

composedPath() broken for tap event on touch devices #4670

Saulis opened this issue Jun 6, 2017 · 1 comment
Assignees
Labels

Comments

@Saulis
Copy link

Saulis commented Jun 6, 2017

Description

event.composedPath() is missing the composed elements within shadow root on tap event on touch devices. Native events and atleast down and up gesture events work as expected.

Looks to me like the problem is using a Touch object from e.changesTouches[0] as a sourceEvent instead of the original composed event.

Live Demo

http://jsbin.com/pagitax/edit?output

Steps to Reproduce

  1. Tap on "Tap Me!"
  2. See printed out composedPath() in console

Expected Results

Path should start with: ["DIV", "#document-fragment", "MY-ELEMENT", "BODY", "HTML"...]

Actual Results

Path actually starts with: ["MY-ELEMENT", "BODY", "HTML"...]

Verified with

  • Chrome 58 emulating Nexus 5X
  • Chrome 58 emulating iPhone 6
  • iOS Simulator running iPad with iOS 10.3

Versions

  • Polymer: v2.0.x
  • webcomponents: v1.0.x
Saulis added a commit to vaadin/vaadin-combo-box that referenced this issue Jun 6, 2017
@dfreedm dfreedm self-assigned this Jun 6, 2017
@dfreedm
Copy link
Member

dfreedm commented Jun 6, 2017

Yep, you're right. The right fix is probably to use the original TouchEvent in findOriginalTarget to get the proper composedPath

manolo pushed a commit to vaadin/vaadin-combo-box that referenced this issue Jul 8, 2017
dfreedm added a commit that referenced this issue Jul 18, 2017
Always use findOriginalTarget with a real event!

Fixes #4670
knordman pushed a commit to knordman/vaadin-combo-box that referenced this issue Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants