Skip to content

Commit 29149d4

Browse files
committed
change touchpad dir behavior in horizontalScroll : 2.x, 3.x different, If ( horizontalScroll && deltaX !== -0) , invert dlt, can fix it.
1 parent e696fef commit 29149d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jquery.mCustomScrollbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ and dependencies (minified).
14551455
dlt=e.deltaY || delta;
14561456
}
14571457
if((dir==="y" && !d.overflowed[0]) || (dir==="x" && !d.overflowed[1])){return;}
1458-
if(o.mouseWheel.invert){dlt=-dlt;}
1458+
if(o.mouseWheel.invert || (o.horizontalScroll && e.deltaX !== -0)){dlt=-dlt;}
14591459
if(o.mouseWheel.normalizeDelta){dlt=dlt<0 ? -1 : 1;}
14601460
if((dlt>0 && draggerPos!==0) || (dlt<0 && draggerPos!==limit) || o.mouseWheel.preventDefault){
14611461
e.stopImmediatePropagation();

0 commit comments

Comments
 (0)