[Pagination] clicking on "..." triggers onChange with page equals to null (v5) #28853
Closed
2 tasks done
Labels
component: pagination
This is the name of the generic UI component, not the React module!
regression
A bug, but worse
Clicking on
...
triggers PaginationonChange
withpage
equals tonull
. This behavior does not appear in v4.So when migrating to v5, I need to add a safety check for
page !== null
before setting currentpage
value.Current Behavior 😯
Clicking on
...
triggersonChange
withpage
equals tonull
.Expected Behavior 🤔
Clicking on
...
should not trigger any event since it is just a label. Otherwise we always need to check forpage !== null
on every controlled Pagination.Steps to Reproduce 🕹
https://codesandbox.io/s/reverent-sun-e2kwy?file=/src/Demo.tsx
Context 🔦
This behavior does not appear in v4, not sure if this is a new intended behavior, but having to check for
null
on everyPagination
seems not very convenient.Your Environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: