Closed kentcdodds closed 7 years ago
Hey @kentcdodds,
Sorry for the late response. Completely missed this somehow 🤷♂️
I hadn't thought of that particular use case, but I'm sure it's a fairly common one so it would absolutely make sense to support this 👍
I think this behaviour can be handled by slightly tweaking the implementation of scrollToAlignment
. Something like scrollToAlignment="auto"
.
That sounds great :+1: Thanks!
Can't wait to update my example.
Just shipped scrollToAlignment="auto"
with version 2.1.0
. 'auto'
scrolls the least amount possible to ensure that the specified scrollToIndex item is fully visible, which should be the behaviour you're looking for. Let me know how that goes 👍
Thank you! It works great!
Whoops, wrong link. Here's the right one: https://codesandbox.io/s/v670kq95l
Looks awesome 🤓 🎉
I'm trying to support
react-tiny-virtual-list
in a nice way indownshift
and it would be very helpful if there were a way to havereact-tiny-virtual-list
only scroll to an index if that node is not currently visible.See this example and the live demo here.
Thanks!