Skip to content
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

max total number of items for React Pagination component #4070

Closed
zhenwan opened this issue Sep 24, 2019 · 8 comments
Closed

max total number of items for React Pagination component #4070

zhenwan opened this issue Sep 24, 2019 · 8 comments

Comments

@zhenwan
Copy link

zhenwan commented Sep 24, 2019

What is the max number of "total number of items" for React Pagination component?

http://react.carbondesignsystem.com/?path=/story/pagination--pagination

if I entered 500000 to the "Total number of items" field, this component response very slow when I click the next page button. if the number is over 1,000,000 the storybook page crashed.

image

@asudoh
Copy link
Contributor

asudoh commented Sep 25, 2019

Hi 👋 we don't define that. One question; Why did you wonder about such number...?

@zhenwan
Copy link
Author

zhenwan commented Sep 25, 2019

@asudoh I need to know such number so that I won't misuse this component.

@asudoh
Copy link
Contributor

asudoh commented Sep 26, 2019

OK I was asking more of your use case, but if your application really have such large number of pages (the only use case I can imagine is something like email apps, and again we don't have a defined threshold), I'd recommend using pagesUnknown={true}.

@zhenwan
Copy link
Author

zhenwan commented Sep 26, 2019

@asudoh Thank you, good to know pagesUnknow={true} can be used for large number of pages.

I just did a quick test, and see if pagesUnknown={true}, the page number button does not response to mouse click. should this button be disabled if the page number is unknown?

image

@asudoh
Copy link
Contributor

asudoh commented Sep 26, 2019

I just did a quick test, and see if pagesUnknown={true}, the page number button does not response to mouse click. should this button be disabled if the page number is unknown?

Sounds so. Great to have a separate issue for that. Thank you for reporting!

@asudoh asudoh closed this as completed Sep 26, 2019
@nictownsend
Copy link
Contributor

Hi, sorry to reopen but we have hit this problem in our product.

We have a large number of Kafka messages and we created a paginated browser view. This could result in 1000000 items (which is 100000 pages of 10).

Trying to render this in the pagination component causes the browser to crash, as the <select> item has over 100000 <option> elements.

I appreciate that the pageInputDisabled prop is a solution to avoid this - but it then means the user can't easily jump between pages.

Ideally, the storybook should warn about a max size - and then we may need a new approach for handling the large page input changing.

@asudoh
Copy link
Contributor

asudoh commented Oct 29, 2019

Hi 👋 seems a separate issue, as you seem to be requesting for better UI to select a specific page in large list of pages. Feel free to enter an issue for that. Thanks!

@nictownsend
Copy link
Contributor

Hi, am happy to open an issue if it doesn't already exist for the change in UX.

But, I'm also asking that the storybook/readme for the component is updated to warn that a large number of pages will crash the web browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants