react-tiny-virtual-list icon indicating copy to clipboard operation
react-tiny-virtual-list copied to clipboard

Set initial scrollOffset Not working

Open nontachaiwebdev opened this issue 9 years ago • 3 comments

Hi Now i use react-infinite-calendar.An when i click to show in modal calendar is work fine.But have just a problem.Is initial scrollOffset not set initial scroll position for calendar.I try to Debug in this repo but scrollOffset have value when component mount.

thank you

nontachaiwebdev avatar May 10 '17 04:05 nontachaiwebdev

I found some point is work not fine. This code

getNodeOffset() { const {scrollDirection} = this.props; return this.rootNode[scrollProp[scrollDirection]]; }

this.rootNode[scrollProp[scrollDirection]] => this.rootNode[scrollTop] is undefined

nontachaiwebdev avatar May 10 '17 09:05 nontachaiwebdev

This is most likely because you're rendering the calendar in a container that is initially set to display: none. It's not possible to set the scrollTop property of a node if it is set to display: none.

Make sure you only render the calendar once your modal is visible.

clauderic avatar May 10 '17 13:05 clauderic

Oh!!! that right. thankyou

nontachaiwebdev avatar May 10 '17 13:05 nontachaiwebdev