Skip to content

Commit

Permalink
Potentially addressing Firefox+Windows slow wheel scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Feb 17, 2016
1 parent 51794c0 commit 24d0002
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dist/react-virtualized.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/react-virtualized.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion es/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ var Grid = (function (_Component) {
var scrollTop = _state.scrollTop;

// Make sure any changes to :scrollLeft or :scrollTop get applied
if (scrollLeft >= 0 && scrollLeft !== prevState.scrollLeft || scrollTop >= 0 && scrollTop !== prevState.scrollTop) {
if (scrollLeft >= 0 && scrollLeft !== prevState.scrollLeft && scrollLeft !== this.refs.scrollingContainer.scrollLeft) {
this.refs.scrollingContainer.scrollLeft = scrollLeft;
}
if (scrollTop >= 0 && scrollTop !== prevState.scrollTop && scrollTop !== this.refs.scrollingContainer.scrollTop) {
this.refs.scrollingContainer.scrollTop = scrollTop;
}

Expand Down
11 changes: 9 additions & 2 deletions source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,17 @@ export default class Grid extends Component {

// Make sure any changes to :scrollLeft or :scrollTop get applied
if (
(scrollLeft >= 0 && scrollLeft !== prevState.scrollLeft) ||
(scrollTop >= 0 && scrollTop !== prevState.scrollTop)
scrollLeft >= 0 &&
scrollLeft !== prevState.scrollLeft &&
scrollLeft !== this.refs.scrollingContainer.scrollLeft
) {
this.refs.scrollingContainer.scrollLeft = scrollLeft
}
if (
scrollTop >= 0 &&
scrollTop !== prevState.scrollTop &&
scrollTop !== this.refs.scrollingContainer.scrollTop
) {
this.refs.scrollingContainer.scrollTop = scrollTop
}

Expand Down
1 change: 1 addition & 0 deletions source/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
position: relative;
overflow: auto;
outline: 0;
scroll-behavior: smooth; /* Improves mouse wheel scroll speed for Firefox on Windows */
-webkit-overflow-scrolling: touch;
}

Expand Down
1 change: 1 addition & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
position: relative;
overflow: auto;
outline: 0;
scroll-behavior: smooth; /* Improves mouse wheel scroll speed for Firefox on Windows */
-webkit-overflow-scrolling: touch;
}

Expand Down

0 comments on commit 24d0002

Please sign in to comment.