Verify the page number exists.
This commit is contained in:
parent
f93421c750
commit
2e3788a862
|
@ -57,7 +57,7 @@ class Pagination extends Component {
|
||||||
const { onPageChange } = this.props;
|
const { onPageChange } = this.props;
|
||||||
const newPage = parseInt( event.target.value, 10 );
|
const newPage = parseInt( event.target.value, 10 );
|
||||||
|
|
||||||
if ( isFinite( newPage ) ) {
|
if ( isFinite( newPage ) && this.pageCount && this.pageCount >= newPage ) {
|
||||||
onPageChange( newPage );
|
onPageChange( newPage );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue