Skip to content

Commit f4ed900

Browse files
committed
[fixed] correctly updates the window scroll position
1 parent 3fe4d7d commit f4ed900

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

modules/ScrollManagementMixin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ var ScrollManagementMixin = {
6161

6262
if (locationState && this.props.shouldUpdateScrollPosition(this.state, prevState)) {
6363
var { scrollX, scrollY } = locationState;
64-
65-
if (scrollX != null && scrollY != null)
66-
this.props.updateScrollPosition(location.navigationType, scrollX, scrollY);
64+
this.props.updateScrollPosition(location.navigationType, scrollX || 0, scrollY || 0);
6765
}
6866
}
6967

modules/__tests__/scrollManagement-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Scroll management', function () {
2424

2525
Inbox = React.createClass({
2626
render() {
27-
return <p>This is the inbox.</p>;
27+
return <p style={{padding: '100px 3000px 3000px 100px'}}>This is the inbox.</p>;
2828
}
2929
});
3030

0 commit comments

Comments
 (0)