Skip to content

Commit

Permalink
fix: make scrollToTime=00:00 working (jquense#1501)
Browse files Browse the repository at this point in the history
* make scrollToTime=00:00 working

* check _scrollRatio is not null
  • Loading branch information
amok authored and jquense committed Oct 18, 2019
1 parent e622651 commit ee5a558
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TimeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default class TimeGrid extends Component {

this.scrollRef = React.createRef()
this.contentRef = React.createRef()
this._scrollRatio = null
}

componentWillMount() {
Expand Down Expand Up @@ -267,7 +268,7 @@ export default class TimeGrid extends Component {
}

applyScroll() {
if (this._scrollRatio) {
if (this._scrollRatio != null) {
const content = this.contentRef.current
content.scrollTop = content.scrollHeight * this._scrollRatio
// Only do this once
Expand Down

0 comments on commit ee5a558

Please sign in to comment.