Skip to content

Commit ee5a558

Browse files
amokjquense
authored andcommitted
fix: make scrollToTime=00:00 working (jquense#1501)
* make scrollToTime=00:00 working * check _scrollRatio is not null
1 parent e622651 commit ee5a558

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/TimeGrid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class TimeGrid extends Component {
2424

2525
this.scrollRef = React.createRef()
2626
this.contentRef = React.createRef()
27+
this._scrollRatio = null
2728
}
2829

2930
componentWillMount() {
@@ -267,7 +268,7 @@ export default class TimeGrid extends Component {
267268
}
268269

269270
applyScroll() {
270-
if (this._scrollRatio) {
271+
if (this._scrollRatio != null) {
271272
const content = this.contentRef.current
272273
content.scrollTop = content.scrollHeight * this._scrollRatio
273274
// Only do this once

0 commit comments

Comments
 (0)