From ca8d57c4dbfe839db28b583caa7d599c0cfc023a Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 23 Jun 2017 12:09:56 -0400 Subject: PLT-6890 Fix various scrolling issues (#6727) * Fix various scrolling issues * Move reaction scrolling to reaction list * Handle scrolling when RHS opens * Only run scroll update code when posts change --- webapp/components/post_view/reaction_list/reaction_list.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'webapp/components/post_view/reaction_list/reaction_list.jsx') diff --git a/webapp/components/post_view/reaction_list/reaction_list.jsx b/webapp/components/post_view/reaction_list/reaction_list.jsx index 516f5332f..4d2f3a5fc 100644 --- a/webapp/components/post_view/reaction_list/reaction_list.jsx +++ b/webapp/components/post_view/reaction_list/reaction_list.jsx @@ -4,6 +4,8 @@ import React from 'react'; import PropTypes from 'prop-types'; +import {postListScrollChange} from 'actions/global_actions.jsx'; + import Reaction from 'components/post_view/reaction'; export default class ReactionListView extends React.PureComponent { @@ -38,6 +40,12 @@ export default class ReactionListView extends React.PureComponent { } } + componentDidUpdate(prevProps) { + if (this.props.reactions !== prevProps.reactions) { + postListScrollChange(); + } + } + render() { if (!this.props.post.has_reactions || (this.props.reactions && this.props.reactions.length === 0)) { return null; -- cgit v1.2.3-1-g7c22