mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
refactor(pagination): do not coerce pageSize
, page
to be numbers
This commit is contained in:
parent
1cf28c6809
commit
e6188b0c65
1 changed files with 1 additions and 11 deletions
|
@ -85,17 +85,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
$: {
|
||||
if (typeof page !== "number") {
|
||||
page = Number(page);
|
||||
}
|
||||
|
||||
if (typeof pageSize !== "number") {
|
||||
pageSize = Number(pageSize);
|
||||
}
|
||||
|
||||
dispatch("update", { pageSize, page });
|
||||
}
|
||||
$: dispatch("update", { pageSize, page });
|
||||
$: totalPages = Math.max(Math.ceil(totalItems / pageSize), 1);
|
||||
$: selectItems = Array.from({ length: totalPages }, (_, i) => i);
|
||||
$: backButtonDisabled = disabled || page === 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue