question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pagination in the <Select> component

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

Let’s say that I have an endpoint with 2000 items and I want to be able to select one of these items.

It’s not optimal and very expensive to load the entire 2000 items at once in a <Select> component.

What does the proposed API look like?

My proposal is to implement a pagination in the <Select> component: let’s say that we are at page 1 and have 10 items. When the user scrolls down the <Select> and hits the bottom of it, it will fetch the next page (page 2) and 10 more items.

For example:

<Select
  loadOptions={fetchOptions}
  paginate={10}
/>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
zombieJcommented, Sep 28, 2018

ref: https://github.com/ant-design/ant-design/issues/12406#issuecomment-424968753

onPopupScroll = e => {
  e.persist(); 
  let target = e.target;
  if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
    // dynamic add options...
  }
};
0reactions
afc163commented, Oct 31, 2018

@sysuzero 来个 PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pagination - Vue Select
Pagination can be a super helpful tool when working with large sets of data. If you have 1,000 options, the component is going...
Read more >
react-select-async-paginate - npm
Start using react-select-async-paginate in your project by ... Describing type of component with extra props (example with Creatable ):.
Read more >
React Pagination component - Material UI - MUI
The Pagination component enables the user to select a specific page from a range of pages.
Read more >
How can I add paging on the antd select ? Because getting ...
How can I add paging on the antd select ? Because getting data from the interface is huge. So I want to implement...
Read more >
react-select-async-paginate examples - CodeSandbox
Learn how to use react-select-async-paginate by viewing and forking react-select-async-paginate example apps on CodeSandbox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found