dont break room directory and search

This commit is contained in:
Bruno Windels 2019-03-18 14:05:56 +01:00
parent 95e61a57bc
commit d84003ac44
3 changed files with 12 additions and 3 deletions

View file

@ -551,7 +551,6 @@ module.exports = React.createClass({
onFillRequest={ this.onFillRequest } onFillRequest={ this.onFillRequest }
stickyBottom={false} stickyBottom={false}
startAtBottom={false} startAtBottom={false}
onResize={function() {}}
> >
{ scrollpanel_content } { scrollpanel_content }
</ScrollPanel>; </ScrollPanel>;

View file

@ -1799,6 +1799,7 @@ module.exports = React.createClass({
<ScrollPanel ref="searchResultsPanel" <ScrollPanel ref="searchResultsPanel"
className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel" className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel"
onFillRequest={this.onSearchResultsFillRequest} onFillRequest={this.onSearchResultsFillRequest}
resizeNotifier={this.props.resizeNotifier}
> >
<li className={scrollheader_classes}></li> <li className={scrollheader_classes}></li>
{ this.getSearchResultTiles() } { this.getSearchResultTiles() }

View file

@ -135,6 +135,9 @@ module.exports = React.createClass({
/* style: styles to add to the top-level div /* style: styles to add to the top-level div
*/ */
style: PropTypes.object, style: PropTypes.object,
/* resizeNotifier: ResizeNotifier to know when middle column has changed size
*/
resizeNotifier: PropTypes.object,
}, },
getDefaultProps: function() { getDefaultProps: function() {
@ -149,7 +152,10 @@ module.exports = React.createClass({
componentWillMount: function() { componentWillMount: function() {
this._pendingFillRequests = {b: null, f: null}; this._pendingFillRequests = {b: null, f: null};
this.props.resizeNotifier.on("middlePanelResized", this.onResize);
if (this.props.resizeNotifier) {
this.props.resizeNotifier.on("middlePanelResized", this.onResize);
}
this.resetScrollState(); this.resetScrollState();
}, },
@ -173,7 +179,10 @@ module.exports = React.createClass({
// //
// (We could use isMounted(), but facebook have deprecated that.) // (We could use isMounted(), but facebook have deprecated that.)
this.unmounted = true; this.unmounted = true;
this.props.resizeNotifier.removeListener("middlePanelResized", this.onResize);
if (this.props.resizeNotifier) {
this.props.resizeNotifier.removeListener("middlePanelResized", this.onResize);
}
}, },
onScroll: function(ev) { onScroll: function(ev) {