You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-17 17:42:41 +03:00
Merge pull request #3584 from matrix-org/dbkr/fix_rooms_missing_from_search
Fix bug where rooms would not appear when filtering
This commit is contained in:
@@ -67,6 +67,9 @@ const RoomSubList = createReactClass({
|
|||||||
// some values to get LazyRenderList starting
|
// some values to get LazyRenderList starting
|
||||||
scrollerHeight: 800,
|
scrollerHeight: 800,
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
|
// React 16's getDerivedStateFromProps(props, state) doesn't give the previous props so
|
||||||
|
// we have to store the length of the list here so we can see if it's changed or not...
|
||||||
|
listLength: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -79,11 +82,20 @@ const RoomSubList = createReactClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentDidMount: function() {
|
||||||
this._headerButton = createRef();
|
this._headerButton = createRef();
|
||||||
this.dispatcherRef = dis.register(this.onAction);
|
this.dispatcherRef = dis.register(this.onAction);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
statics: {
|
||||||
|
getDerivedStateFromProps: function(props, state) {
|
||||||
|
return {
|
||||||
|
listLength: props.list.length,
|
||||||
|
scrollTop: props.list.length === state.listLength ? state.scrollTop : 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user