[v2] feat(pagination): add async pagination#2464
[v2] feat(pagination): add async pagination#2464TheSharpieOne wants to merge 2 commits intoJedWatson:v2from
Conversation
6130c15 to
cfe56a4
Compare
cfe56a4 to
7c3f1d7
Compare
|
Rebased. v2's tests are currently failing and now this branch will too :D |
|
Nice work @TheSharpieOne, you're all over it. @JedWatson let me know if you need any help maintaining this package. |
73b7d1f to
072aeb2
Compare
|
When this will be merged? :) |
|
Would love to see this merged as soon as possible! |
|
+1 |
|
My company is using a fork of |
|
Just FYI my changes have been published to @thesharpieone/react-select-async-pagination Also, the Async component is pretty simple (mostly managing cache and calling a user defined function to get the options), this could definitely be a third-party package which uses react-select under the hood so that this feature doesn't need to be in the "core" package. |
|
@TheSharpieOne Is there any chance this gets merged soon? It's a nice feature I would like to use in my project. |
|
@jelteliekens it's not up to me. |
|
Can't wait :3 |
|
+1 |
|
I just want to know the main reason behind blocking this PR? |
Just like #1237, but for v2.
This adds a new
paginationprop to theSelect.Aynccomponent. It is a boolean which isfalseby default (false: things act as they did before it was added). WhenpaginationistrueloadOptionsis given an additional argument;page.pagetells the user'sloadOptionsfunction 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.loadOptionsis 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.