Fix grabQuestion on mobile

This commit is contained in:
Berkeley Martinez
2016-01-09 22:18:17 -08:00
parent 553f87822c
commit 2277cde61b

View File

@ -108,9 +108,14 @@ export default Actions({
}, },
grabQuestion(e) { grabQuestion(e) {
const { pageX, pageY } = e; let { pageX, pageY, touches } = e;
if (touches) {
e.preventDefault();
// these re-assigns the values of pageX, pageY from touches
({ pageX, pageY } = touches[0]);
}
const delta = [pageX, pageY]; const delta = [pageX, pageY];
const mouse = getMouse(e, delta); const mouse = [0, 0];
return { return {
transform(state) { transform(state) {