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

Cancel touch events when treating them as mouse events #1172

Merged
merged 1 commit into from
Jan 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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