From 94f8be51f91203d5d6ccbd99dd721b7e945791bf Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 12 May 2016 21:35:55 -0400 Subject: Properly updated FilteredUserList when the provided user list is changed (#2983) --- webapp/components/filtered_user_list.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'webapp/components') diff --git a/webapp/components/filtered_user_list.jsx b/webapp/components/filtered_user_list.jsx index 4270d3731..fca68a81a 100644 --- a/webapp/components/filtered_user_list.jsx +++ b/webapp/components/filtered_user_list.jsx @@ -43,6 +43,15 @@ class FilteredUserList extends React.Component { }; } + componentWillUpdate(nextProps) { + // assume the user list is immutable + if (this.props.users !== nextProps.users) { + this.setState({ + users: this.filterUsers(nextProps.teamMembers, nextProps.users) + }); + } + } + componentDidUpdate(prevProps, prevState) { if (prevState.filter !== this.state.filter) { $(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0); -- cgit v1.2.3-1-g7c22