[autocomplete] Support pagination with async requests
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Would 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/material-ui/src/Autocomplete/Autocomplete.d.ts and compare the proposed loadingMore and loadingMoreText API with the pagination examples in the linked react-select and Select2 references. Define how asynchronous pages are requested and appended, then verify that loading and completion states are represented consistently in the Autocomplete API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100