react-virtualized icon indicating copy to clipboard operation
react-virtualized copied to clipboard

`scrollToIndex` doesn't work when `scrollTop` is set in List

Open aayushdutt opened this issue 4 years ago • 2 comments

Bug Report

I have to use both scroll-sync (which requires setting scrollTop) and scrollToIndex to navigate to a page, but scrollToIndex doesn't work seemingly due to scrollTop is already set by ScrollSync Any idea?

aayushdutt avatar Jul 28 '21 08:07 aayushdutt

I got it working with a hacky workaround. Used a useEffect to set scrollTop to null when scrollToIndex changes.

aayushdutt avatar Sep 12 '21 21:09 aayushdutt

@aayushdutt This worked! Since i'm using WindowScroller, i ended up doing the following scrollTop={isScrolling && scrollTop}

ibbeyo avatar Jun 09 '22 17:06 ibbeyo