wieringen / tinyscrollbar

A lightweight cross browser javascript scrollbar.
http://baijs.com/tinyscrollbar
Other
398 stars 202 forks source link

Fixed case in FF when evntObj.deltaY is zero; #70

Open oxala opened 8 years ago

oxala commented 8 years ago

Found an edge-case when after some intensive scrolling in FireFox - evntObj.deltaY at one point is zero. And since evntObj.wheelDelta is undefined, the wheelDelta variable becomes NaN. Which breaks further scrolling (as visible from screenshots below).

image

image

The fix added - falling back on zero, if any of evntObj.deltaY || evntObj.detail || (-1 / 3 * evntObj.wheelDelta) is falsy.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 53.498% when pulling ab9d1f3372b34725ce9ca853133c16cbce2b1f68 on oxala:master into 93c8a51457a67e57a84008d2254f436206cb3098 on wieringen:master.