Add support for multitouch over separate child elements. Fixes #600 #668

Merged
merged 3 commits into from Sep 16, 2014

Conversation

Projects
None yet
3 participants
@bumbu
Contributor

bumbu commented Sep 15, 2014

This fix requires hammerjs/simulator#2

The fix is based on recalculating targetTouches based on available touches. Only touches that correspond to observable element or to its child elements are marked as targetTouches.

It may be not the best place to check for touches (or naming of targetTouches should be changed) but because library heavily relies on targetTouches it was the easiest place to make the change.

Tests pass in Chrome 37, Firefox 32, Safari 7 (OS X).
Live testing works in Safari (iOS 7).

Added 3 tests that cover following use-cases:

  • Pinching and rotating
  • Both touches are over child elements
  • One touch is over observed element and one touch is over child element

Fixed an older test by adding a target attribute to each touch.

jtangelder added a commit that referenced this pull request Sep 16, 2014

Merge pull request #668 from bumbu/multielement
Add support for multitouch over separate child elements. Fixes #600

@jtangelder jtangelder merged commit 10a2909 into hammerjs:master Sep 16, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details
@jtangelder

This comment has been minimized.

Show comment
Hide comment
@jtangelder

jtangelder Sep 16, 2014

Member

I'm thinking about to create also a simple 'single user' touch input handler. almost all logic in this handler is for multi-user, and could be simplified (=faster). And let user set the multi-user handler as an option.
Something for 3.1 I guess.

Member

jtangelder commented Sep 16, 2014

I'm thinking about to create also a simple 'single user' touch input handler. almost all logic in this handler is for multi-user, and could be simplified (=faster). And let user set the multi-user handler as an option.
Something for 3.1 I guess.

@DallanQ

This comment has been minimized.

Show comment
Hide comment
@DallanQ

DallanQ Sep 28, 2014

I just ran across this issue. I updated to the master branch and it's fixed. Thank you! Hammer.js is awesome.

DallanQ commented Sep 28, 2014

I just ran across this issue. I updated to the master branch and it's fixed. Thank you! Hammer.js is awesome.

@jtangelder

This comment has been minimized.

Show comment
Hide comment
@jtangelder

jtangelder Sep 28, 2014

Member

Just released it in the 2.0.4 :-)

Member

jtangelder commented Sep 28, 2014

Just released it in the 2.0.4 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment