From f4ed900650462c73309d0e6d7503715f166eb732 Mon Sep 17 00:00:00 2001 From: Mattias Rydengren Date: Tue, 30 Jun 2015 17:35:13 +0200 Subject: [PATCH] [fixed] correctly updates the window scroll position --- modules/ScrollManagementMixin.js | 4 +--- modules/__tests__/scrollManagement-test.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/ScrollManagementMixin.js b/modules/ScrollManagementMixin.js index b4f4966d37..fc5ee5e8f3 100644 --- a/modules/ScrollManagementMixin.js +++ b/modules/ScrollManagementMixin.js @@ -61,9 +61,7 @@ var ScrollManagementMixin = { if (locationState && this.props.shouldUpdateScrollPosition(this.state, prevState)) { var { scrollX, scrollY } = locationState; - - if (scrollX != null && scrollY != null) - this.props.updateScrollPosition(location.navigationType, scrollX, scrollY); + this.props.updateScrollPosition(location.navigationType, scrollX || 0, scrollY || 0); } } diff --git a/modules/__tests__/scrollManagement-test.js b/modules/__tests__/scrollManagement-test.js index 012ee5c9c6..771d049855 100644 --- a/modules/__tests__/scrollManagement-test.js +++ b/modules/__tests__/scrollManagement-test.js @@ -24,7 +24,7 @@ describe('Scroll management', function () { Inbox = React.createClass({ render() { - return

This is the inbox.

; + return

This is the inbox.

; } });