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

[Pagination] Fix clicking on ... triggers onChange with page value null #28884

Merged

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Oct 7, 2021

Fixes #28853

Do not pass pagination item props to an ellipsis div which includes a onClick event listener.
The onClick handler triggers the onChange if passed and for ellipsis type (start-ellipsis, end-ellipsis) the page value got mapped as null .

As per my investigation, the bug got introduced since 5.0.0-alpha.27 in #25146


CodeSandbox after fix.

@ZeeshanTamboli ZeeshanTamboli self-assigned this Oct 7, 2021
@ZeeshanTamboli ZeeshanTamboli added component: pagination This is the name of the generic UI component, not the React module! regression A bug, but worse labels Oct 7, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Oct 7, 2021

Details of bundle changes

Generated by 🚫 dangerJS against 7049774

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for your help!

@michaldudak michaldudak merged commit ea22ca9 into mui:master Oct 7, 2021
@michaldudak michaldudak added the package: material-ui Specific to @mui/material label Oct 7, 2021
@ZeeshanTamboli ZeeshanTamboli deleted the issue/28853-pagination-onChange-null branch October 7, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pagination This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pagination] clicking on "..." triggers onChange with page equals to null (v5)
3 participants