Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed issue where mousewheel events on a horizontally scrolling insta…

…nce would prevent page scrolling (#2532739)
  • Loading branch information...
commit b49a61465417ae8914c3053cc5de13ad22d55977 1 parent c2acffa
@derek authored
View
2  src/scrollview/HISTORY.md
@@ -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
View
8 src/scrollview/js/scrollview-base.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.