From 9de059571fa6ba633977fcc2be6d48ddb8b677d0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 19 Jun 2018 01:13:42 +0300 Subject: fix scroll on paging --- vnext/src/components/Feeds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnext/src/components/Feeds.js b/vnext/src/components/Feeds.js index f7abd399..f0a3c523 100644 --- a/vnext/src/components/Feeds.js +++ b/vnext/src/components/Feeds.js @@ -56,8 +56,6 @@ class Feed extends React.Component { this.loadMessages = this.loadMessages.bind(this); } componentDidMount() { - document.body.scrollTop = 0; - document.documentElement.scrollTop = 0; this.loadMessages(this.props.visitor.hash, this.props.location.search); } componentWillReceiveProps(nextProps) { @@ -67,6 +65,8 @@ class Feed extends React.Component { } } loadMessages(hash = '', filter = '') { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; this.setState({ msgs: [] }) const filterParams = qs.parse(filter); let params = Object.assign({}, filterParams || {}, this.props.query.search || {}); -- cgit v1.2.3