I have a <List>
component. I am building a feature where it:
- Scrolls to a particular row in the
<List>
. It does by using thescrollToIndex
prop. - Scrolls to a particular line in that row. It does this by doing
document.getElementById('myId').scrollIntoView()
.
How can I ensure that step (2) occurs after step (1)?
Note: I have already tried the onRowsRendered()
but it looks like that is not always executed after scrollTo
.
Documentation is here, but unfortunately I'm quite stuck.
Edit: In case anyone comes across this question in future, I got kind of an answer over at the GitHub repo:
the
onScroll
prop you pass in is bound to the htmlonscroll
event which is triggered every moment you scroll. ThescrollToIndex
prop is used to calculate thescrollTop
and then is manually set on the html element.
https://github.com/bvaughn/react-virtualized/issues/1077#issuecomment-381438215
` component directly?
– user3812429 Apr 21 '18 at 16:53