mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
Correct page number when dispatching update
When in last page of data and the page size get changed to a bigger size the current page number will be out of range of total pages. This code will set the page number in range of total pages.
This commit is contained in:
parent
62b71305d6
commit
6426bea7f2
1 changed files with 2 additions and 0 deletions
|
@ -84,6 +84,8 @@
|
||||||
page = Number(page);
|
page = Number(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page = page > totalPages ? totalPages : page;
|
||||||
|
|
||||||
if (typeof pageSize !== "number") {
|
if (typeof pageSize !== "number") {
|
||||||
pageSize = Number(pageSize);
|
pageSize = Number(pageSize);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue