[Autocomplete] support pagination on Asynchronous requests
See original GitHub issueWould be very nice to add any ability for support pagination on Asynchronous requests Many resources have limitations on requests and we can not get all results at once Also reading everything page by page can lead to exceed limit of requests and it will be too slow
We would likely need to extend the API:
diff --git a/packages/material-ui/src/Autocomplete/Autocomplete.d.ts b/packages/material-ui/src/Autocomplete/Autocomplete.d.ts
index a2929c4867..39fa7130b3 100644
--- a/packages/material-ui/src/Autocomplete/Autocomplete.d.ts
+++ b/packages/material-ui/src/Autocomplete/Autocomplete.d.ts
@@ -143,6 +143,11 @@ export interface AutocompleteProps<
* @default false
*/
loading?: boolean;
+ /**
+ * If `true`, the `loadingMoreText` message is displayed at the bottom of the displayed options.
+ * @default false
+ */
+ loadingMore?: boolean;
/**
* Text to display when in a loading state.
*
@@ -150,6 +155,13 @@ export interface AutocompleteProps<
* @default 'Loading…'
*/
loadingText?: React.ReactNode;
+ /**
+ * Text to display when in a loading more state.
+ *
+ * For localization purposes, you can use the provided [translations](/guides/localization/).
+ * @default 'Loading more…'
+ */
+ loadingMoreText?: React.ReactNode;
/**
* The maximum number of tags that will be visible when not focused.
* Set `-1` to disable the limit.
Benchmark
Issue Analytics
- State:
- Created 4 years ago
- Reactions:71
- Comments:31 (13 by maintainers)
Top Results From Across the Web
[Autocomplete] support pagination on Asynchronous requests
Hello! How can I do that after all? So, the Autocomplete component supports pagination on async requests? Thank you!
Read more >React Autocomplete component - Material UI - MUI
The component supports two different asynchronous use-cases: Load on open: it waits for the component to be interacted with to load the options....
Read more >react-select-async-paginate - npm
Collected additional data e.g. current page number etc. For first load it is additional from props, for next is additional from previous ...
Read more >react-window-infinite-loader material-ui autocomplete
I am trying to show an infinite scrolled list inside a material-ui Autocomplete dropdown list, using react-window-infinite-loader.
Read more >Implementing react-select Async with React Hooks and ...
This tutorial is about implementing the React Component react-select with Async AJAX request and pagination applied.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, if you provide a custom
ListboxComponentcomponent or you can detect the scroll-bottom with:@vadimka123 I’m not sure to understand the use case. From my perspective, pagination should not be necessary. Either you request the data incrementally and add them to the list of options, then once the list is fully loaded, you enable the search. Or you really have too much data and you opt for an instant search like call API, for each keystroke. What do you think?