From 1024f4b0aa5382a1d6509299f68e97ea2474b32d Mon Sep 17 00:00:00 2001 From: Maksym Kolodezhnyi Date: Fri, 18 Oct 2019 19:29:11 +0300 Subject: [PATCH 1/2] make scrollToTime=00:00 working --- src/TimeGrid.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TimeGrid.js b/src/TimeGrid.js index d0379cfef..904b90547 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -24,6 +24,7 @@ export default class TimeGrid extends Component { this.scrollRef = React.createRef() this.contentRef = React.createRef() + this._scrollRatio = null } componentWillMount() { @@ -267,7 +268,7 @@ export default class TimeGrid extends Component { } applyScroll() { - if (this._scrollRatio) { + if (typeof this._scrollRatio === 'number') { const content = this.contentRef.current content.scrollTop = content.scrollHeight * this._scrollRatio // Only do this once From fa3e0fce9e9f39ed50a49ebd95a490f94326148d Mon Sep 17 00:00:00 2001 From: Maksym Kolodezhnyi Date: Fri, 18 Oct 2019 19:36:00 +0300 Subject: [PATCH 2/2] check _scrollRatio is not null --- src/TimeGrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TimeGrid.js b/src/TimeGrid.js index 904b90547..4b96af890 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -268,7 +268,7 @@ export default class TimeGrid extends Component { } applyScroll() { - if (typeof this._scrollRatio === 'number') { + if (this._scrollRatio != null) { const content = this.contentRef.current content.scrollTop = content.scrollHeight * this._scrollRatio // Only do this once