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

"Feature Request: Infinite Scroll Up Support for bubble.list" #367

Open
iaminnasr opened this issue Dec 17, 2024 · 2 comments
Open

"Feature Request: Infinite Scroll Up Support for bubble.list" #367

iaminnasr opened this issue Dec 17, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@iaminnasr
Copy link

需求动机

Description

It would be a great enhancement to add infinite scroll upwards support for bubble.list. This is especially useful for chat applications or similar use cases where users scroll up to load older content.

Currently, bubble.list supports regular infinite scrolling downwards, but there is no built-in support for upwards scrolling.


Use Case

For chat-based applications or timelines, when users reach the top of the scroll container, they expect older data to load seamlessly. Implementing infinite scroll upwards will greatly improve user experience.


Expected Behavior

  1. When the user scrolls to the top of the bubble.list:

    • A callback function like onScrollUp is triggered.
    • New data is fetched and prepended to the list without shifting the scroll position abruptly.
  2. Maintain the current scroll position to avoid user confusion.


提议的 API 是什么样的?

Proposed API

Add a prop like:

<bubble.list
onLoadMore={onLoadMore}
  hasMoreUp={true} // Whether there is more data to load upwards
  loadingUp={isLoading} // Show loading indicator
/>
@YumoImer
Copy link
Collaborator

YumoImer commented Dec 17, 2024

You can use react-infinite-scroll-component with Bubble.List. react-infinite-scroll-component performs excellently in this regard. I think it would be helpful to add a demo example to assist developers.

https://github.com/ankeetmaini/react-infinite-scroll-component

@YumoImer YumoImer added the documentation Improvements or additions to documentation label Dec 17, 2024
@iaminnasr
Copy link
Author

Hi
Thank you so much for your prompt response and the helpful suggestion! I appreciate your recommendation regarding react-infinite-scroll-component and Bubble.List.

If possible, could you kindly provide a demo example that integrates both virtual scrolling and infinite scroll? I believe it would greatly assist developers who aim to implement high-performance lists.

Thanks again for your support and contribution!

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants