Skip to content

Commit

Permalink
Merge pull request #1172 from starwed/touch-dispatch-prevent-default
Browse files Browse the repository at this point in the history
Cancel touch events when treating them as mouse events
  • Loading branch information
starwed authored Jan 26, 2018
2 parents 23bc903 + 48d9cf0 commit 69762bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/inputs/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Crafty.extend({
*
* If this is set to true, it is expected that your entities have the `Touch` component instead of the `Mouse` component.
* If false (default), then only entities with the Mouse component will respond to touch.
* It's recommended to add the `Button` component instead, which requires the proper component depending on this feature.
* For simple use cases, tt's recommended to add the `Button` component instead, which requires the proper component depending on this feature.
*
* @note The multitouch feature is currently incompatible with the `Draggable` component and `Crafty.viewport.mouselook`.
* @note When multitouch is not enabled, Crafty will cancel touch events when forwarding them to the mouse system.
*
* @example
* ~~~
Expand Down Expand Up @@ -97,6 +98,7 @@ Crafty.extend({
first.target.dispatchEvent(simulatedEvent);
}
}
e.preventDefault();
}

return function(e) {
Expand Down

0 comments on commit 69762bc

Please sign in to comment.