Skip to content
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

Add easier way to scroll to the bottom of the list #593

Open
sartak opened this issue Oct 29, 2023 · 0 comments
Open

Add easier way to scroll to the bottom of the list #593

sartak opened this issue Oct 29, 2023 · 0 comments

Comments

@sartak
Copy link

sartak commented Oct 29, 2023

Feature Request

Describe the Feature

I'd like a way to scroll to the bottom of the list.

Describe the Solution You'd Like

Either a scrollToBottom callback, or have the scrollTo callback take an option to go to the bottom.

const { scrollToBottom } = useVirtual({});
scrollToBottom();
scrollToBottom({ smooth: true });
const { scrollTo } = useVirtual({});
scrollTo("bottom");
scrollTo({ offset: "bottom", smooth: true });

Describe Alternatives You've Considered

I currently implement this with scrollToItem({ index: itemCount - 1, align: "end" });, though it required me rearranging some code. This is also what's used in the "stick to bottom" example.

Additional Information

Thanks!

@sartak sartak changed the title Add a way to scroll to the bottom of the list Add easier way to scroll to the bottom of the list Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant