1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-19 20:23:18 +03:00

Add feature to ResizeNotifier to maintain isResizing state and use it to skip onScroll handling

This commit is contained in:
Michael Telatynski
2020-09-02 12:00:35 +01:00
parent 6178b3c0e2
commit cffe902504
9 changed files with 51 additions and 13 deletions

View File

@ -166,7 +166,7 @@ export default createReactClass({
this._pendingFillRequests = {b: null, f: null};
if (this.props.resizeNotifier) {
this.props.resizeNotifier.on("middlePanelResized", this.onResize);
this.props.resizeNotifier.on("middlePanelResizedNoisy", this.onResize);
}
this.resetScrollState();
@ -196,11 +196,12 @@ export default createReactClass({
this.unmounted = true;
if (this.props.resizeNotifier) {
this.props.resizeNotifier.removeListener("middlePanelResized", this.onResize);
this.props.resizeNotifier.removeListener("middlePanelResizedNoisy", this.onResize);
}
},
onScroll: function(ev) {
if (this.props.resizeNotifier.isResizing) return; // skip scroll events caused by resizing
debuglog("onScroll", this._getScrollNode().scrollTop);
this._scrollTimeout.restart();
this._saveScrollState();