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

[Table] Fix demo parse rowsPerPage value as an integer #14848

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

SimplyAhmazing
Copy link
Contributor

The pagination example has a bug where the rowsPerPage field is set to a string when you click on the dropdown. This is because handleChangeRowsPerPage method uses event.target.value which is a string value.

To replicate this bug. Set page size to 10 then back to 5 and then click the next page button and you'll see that page 2 doesn't show 5 elements instead it shows 10. The rowsPerPage value is not recognized and I traced it down to it being set as a string instead of an integer.

Working example: https://codesandbox.io/s/52y11rp96p

@oliviertassinari oliviertassinari changed the title Demo bug fix: parse rowsPerPage value as an integer [Table] Fix demo parse rowsPerPage value as an integer Mar 11, 2019
@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: table This is the name of the generic UI component, not the React module! labels Mar 11, 2019
@oliviertassinari oliviertassinari self-assigned this Mar 11, 2019
The pagination example has a bug where the rowsPerPage field is set to a string when you click on the dropdown. This is because `handleChangeRowsPerPage` method uses `event.target.value` which is a string value.

To replicate this bug. Set page size to `10` then back to `5` and then click the next page button and you'll see that page 2 doesn't show 5 elements instead it shows 10. The `rowsPerPage` value is not recognized and I traced it down to it being set as a string instead of an integer.
@oliviertassinari oliviertassinari changed the base branch from master to next March 11, 2019 21:42
@mui-pr-bot
Copy link

No bundle size changes comparing 081abcf...6164349

Generated by 🚫 dangerJS against 6164349

@oliviertassinari oliviertassinari merged commit ec1019d into mui:next Mar 12, 2019
@oliviertassinari
Copy link
Member

@SimplyAhmazing Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants