-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
DataViews: Fix pagination on manual input #55940
Conversation
2cf598c
to
b586c79
Compare
Size Change: +5 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
@@ -83,16 +83,17 @@ function Pagination( { | |||
min={ 1 } | |||
max={ totalPages } | |||
onChange={ ( value ) => { | |||
const _value = +value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix? Can you explain it. It's a bit obscure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of the input on the onChange
callback is a string
and we keep an integer in our view config. That made some strict checks to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, maybe we should do parseInt
instead of the +
trick. (as you wish)
What?
Fixes: #55937
When manually entering a page number in the pagination control, an invalid page number incorrectly enables the previous pagination controls, allowing the user to "access" pages below 1.
Testing Instructions