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

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

Merged
merged 3 commits into from
Sep 16, 2014

Conversation

bumbu
Copy link
Contributor

@bumbu 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
Add support for multitouch over separate child elements. Fixes #600
@jtangelder jtangelder merged commit 10a2909 into hammerjs:master Sep 16, 2014
@jtangelder
Copy link
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.

@DallanQ
Copy link

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
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants