Permalink
Browse files

Fixed issue where mousewheel events on a horizontally scrolling insta…

…nce would prevent page scrolling (#2532739)
  • Loading branch information...
1 parent c2acffa commit b49a61465417ae8914c3053cc5de13ad22d55977 @derek derek committed Sep 11, 2012
Showing with 8 additions and 2 deletions.
  1. +2 −0 src/scrollview/HISTORY.md
  2. +6 −2 src/scrollview/js/scrollview-base.js
@@ -20,6 +20,8 @@ ScrollView Change History
FRAME_STEP to 'frameDuration'
BOUNCE_RANGE to 'bounceRange'
+ * Fix: Mousewheel events on a horizontally scrolling instance no longer prevent page scrolling (#2532739)
+
* Fix: Mousewheel events now properly update the `scrollY` attribute.
* Fix: Improved reliability of the scrollEnd event. Now it now only fires
@@ -852,8 +852,12 @@ Y.ScrollView = Y.extend(ScrollView, Y.Widget, {
scrollToY = _constrain(scrollToY, sv._minScrollY, sv._maxScrollY);
- if (bb.contains(e.target)) {
-
+ // Because Mousewheel events fire off 'document', every ScrollView widget will react
+ // to any mousewheel anywhere on the page. This check will ensure that the mouse is currently
+ // over this specific ScrollView. Also, only allow mousewheel scrolling on Y-axis,
+ // becuase otherwise the 'prevent' will block page scrolling.
+ if (bb.contains(e.target) && sv._cAxis[DIM_Y]) {
+
// Reset lastScrolledAmt
sv.lastScrolledAmt = 0;

0 comments on commit b49a614

Please sign in to comment.