Properly updated FilteredUserList when the provided user list is changed (#2983)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
9a701b7e5b
Коммит
94f8be51f9
@@ -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) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
if (prevState.filter !== this.state.filter) {
|
if (prevState.filter !== this.state.filter) {
|
||||||
$(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0);
|
$(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user