Skip to content

Commit

Permalink
Cancel touch events when treating them as mouse events
Browse files Browse the repository at this point in the history
  • Loading branch information
starwed committed Jan 21, 2018
1 parent 23bc903 commit 48d9cf0
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 48d9cf0

Please sign in to comment.