kamal951
kamal951

Reputation: 187

React indiana scroll - initial scroll doesn't work

I would like to initialize my component to an initial scroll with react-indiana-drag-scroll but it doesn't work and I don't know why.

You will find the code on this sandbox.

I would like to initialize the scroll on the red line (current time), but the scrollTo function doesn't work in this code.

Upvotes: 1

Views: 604

Answers (1)

kamal951
kamal951

Reputation: 187

ScrollTo function didn't work because the component isn't fully constructed when we call the function. Instead of constructing it in componentDidMount(), I did it in componentWillMount() and called scrollTo in componentDidMount().

See the code : here

Upvotes: 1

Related Questions