-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to scrollBy with smooth option? #387
Comments
Hi, it's not implemented yet because it wasn't requested until now. |
specifically for mobile. When the keyboard comes up, I want to smoothly scroll the scrollview down by Y pixels to match the keyboard resize :) |
Thanks! As a workaround, you can use native useEffect(() => {
const handle = document.querySelector('.handle');
handle.scrollBy({ top: 1000, behavior: 'smooth' });
}, [])
<VList className="handle">
{...}
</VList> or with Virtualizer: const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
ref.current.scrollBy({ top: 1000, behavior: 'smooth' });
}, [])
<div style={{ overflowY: 'auto'}} ref={ref}>
<Virtualizer>
{...}
</Virtualizer>
</div> It seems that correct usecase so maybe we should add smooth option to VList's scrollBy. |
I see the interface scrollToIndex takes optional parameter "smooth" but I'm not seeing the same interface for scrollBy(offset). Can someone help confirm? Thanks
The text was updated successfully, but these errors were encountered: