-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(pagination): add async pagination #1237
feat(pagination): add async pagination #1237
Conversation
A separate callback prop |
1c8f2df
to
f34d3e4
Compare
Rebased to fix conflicts. @JedWatson or someone please review before it conflicts again or just gets lost in the pile. This feature is on the roadmap to v1. @syndbg you can use the
It's a simple function, and since debouncing has been left to the user of the library to implement (in user-land), It is probably best to leave this in user-land as well. |
Thank you for your contribution, we would love pagination support for react-select. Our API works with an We would like to save the |
f34d3e4
to
ab26c5a
Compare
Rebased once again to remove conflicts.... @lucaas that is a pretty specific use case. The problem is, react-select's async doesn't know anything about the call or the response, only the options you pass to it. Meaning your code handles making the call and parsing the response. You could technically store that value in your code. I do see this use case in things like AWS's dynamodb, where all you get is a pointer to where it left off from last time and thus, where to start from in the next query/page. I'm not 100% sure what a clean implementation for this would look like. The callback does currently accept an object. It only looks for and uses the Honestly, after almost a month and 2 rebases to resolve conflicts, I don't think this feature will get merged anyways, but I'd love for some input from a collaborator about adding the offset/pointer. |
Instead of me trying to keep this PR from conflicting by rebasing all of the time just for it to conflict again after another week of sitting here... Just let me know when you are ready for this feature and I will rebase then. |
@JedWatson can you take a look at this? |
ab26c5a
to
f507725
Compare
@JedWatson this is something we'd really like to see in react-select too, let me know if there's anything that can be done to help get it in! |
Just merge this already. It's really annoying to use repo from github and maintain it by my self. |
f507725
to
f84e501
Compare
@JedWatson Is there anything still pending for this to be merged? We are using this, and this is working fine. |
@JedWatson My team, at work, has been waiting for a while for this feature. Is there anything holding you back from merging this feature? |
@JedWatson It's about time to make something regarding this PR. How can we help to get this merged? |
@JedWatson anything I can do to help? Thanks |
@TheSharpieOne I've testing your example and it doesn't work to me. When I get to the latest element, the second page is not being requested (just cloned your repo) |
I am on mac, branch feature/async-pagination of my repo (but I believe that is the branch you meant) |
Definitely looks like something funky with the numbers not adding up. |
Any update on this? |
Hi I'm also wondering if there is an update to when this will be ready please? |
@JedWatson can you spare 30 seconds illuminating us why you haven't merged this, or even engaging with the conversation? |
Hi @JedWatson, we all miss you. Could you please take a look on that, there's a lot of people waiting for it. |
+1 for this - I'd really like to see this merged :) |
Please, could you merge this PR? Its really important to have this. |
Would reallllllllly love this PR. Can we please get some attention on this? We're currently trying emulate this behavior with our own state / getOptions function which is just future tech-debt... 🙏 📿 |
…to feature/async-pagination
Please update this. |
Wow its been two years now! @TheSharpieOne seems like an issue with deploy.. |
Can I know please why we do not have this PR merged? |
Closing this as at this point it never going to get merged. I'll reopen if a maintainer chimes in stating otherwise. |
Reopen this!!! |
development has moved on. This was for pre-1.0, it's now on 3.0 with a complete rewrite. The PR was open for over 2 years, it's never going to merge. give https://github.com/vtaits/react-select-async-paginate a try. |
Pretty sad that it's been asked for so much and there was so much work put into this PR and @JedWatson never even bothered saying anything about it and here we are years later and it's still not a feature. |
This checks the first box in this list for v1.0.0 and closes #644
This adds a new
pagination
prop to theSelect.Aync
component. It is a boolean which isfalse
by default (false
: things act as they did before it was added). Whenpagination
istrue
loadOptions
is given an additional argument;page
.page
tells the user'sloadOptions
function which page to load (they can use to when building their request). Additional page results are appended to the options list. Changing the input value will reset the page back to1
.loadOptions
is called when the user scrolls to the bottom of the menu list, trigger the next page of results to be appended.Caching is used! (Cache all the things!). If a user scrolls down enough to load additional pages, then changes the input (triggering new requests), then enters the original input, all of the pages for the original input will be loaded back and when the user scroll to the bottom again, it will pick up on the page it left off on.
Documentation has been updated to reflect the new prop and how it affects loadOptions' signature.
EDIT: