Permalink
Browse files

fixed issue with firefox trapping cross axis events

  • Loading branch information...
garris committed Apr 9, 2015
1 parent 4e5680a commit fcead4ee9b1a814c0b49916da091d84538e32406
Showing with 8 additions and 9 deletions.
  1. +8 −9 src/Grid.js
View
@@ -1241,7 +1241,7 @@ define([
case 'dragleft':
// === manually block page scroll ===
// === manually block cross axis page scroll ===
// if in horizontal config and the user is scrolling horizontally
// or if in vertical config and the user is scrolling vertically
@@ -1253,20 +1253,17 @@ define([
}else if(this.sx){//is horizontal config
// if(ev.gesture.deltaX != 0){//this old bit was recently disabled
if(Math.abs(ev.gesture.deltaY/ev.gesture.deltaX) <= 1){ // if this ratio is 1 or less then the user is scrolling the scroll axis: so block native events
//ignore firefox DOMMouseScroll events
if(!/DOMMouseScroll/.test(ev.type) && Math.abs(ev.gesture.deltaY/ev.gesture.deltaX) <= 1){ // if this ratio is 1 or less then the user is scrolling the scroll axis: so block native events
shuntEvent(ev);
}
// }
}else{// is vertical config
// if(ev.gesture.deltaY != 0){//this old bit was recently disabled -- not needed now?
if(Math.abs(ev.gesture.deltaX/ev.gesture.deltaY) <= 1){ // if this ratio is 1 or less then the user is scrolling the scroll axis: so block native events
//ignore firefox DOMMouseScroll events
if(!/DOMMouseScroll/.test(ev.type) && Math.abs(ev.gesture.deltaX/ev.gesture.deltaY) <= 1){ // if this ratio is 1 or less then the user is scrolling the scroll axis: so block native events
shuntEvent(ev);
}
// }
}// config case
// === END: manually block page scroll ===
@@ -1278,7 +1275,9 @@ define([
if(!this.getLastSelected())
this.setLastSelected(this.getClosestScrollOriginObj());
//incase we are at the begining of a touch event or incase this is a fallthrough WheelEvent
if(fingeredOffset==0 || /wheel|scroll/.test(ev.type)){
fingeredOffset = this.scrollPos;

0 comments on commit fcead4e

Please sign in to comment.