diff --git a/packages/calcite-components/src/components/pagination/pagination.e2e.ts b/packages/calcite-components/src/components/pagination/pagination.e2e.ts index f0393dad43b..a7d678eb83a 100644 --- a/packages/calcite-components/src/components/pagination/pagination.e2e.ts +++ b/packages/calcite-components/src/components/pagination/pagination.e2e.ts @@ -39,7 +39,7 @@ describe("calcite-pagination", () => { defaults("calcite-pagination", [ { propertyName: "totalItems", - defaultValue: 1, + defaultValue: 0, }, { propertyName: "startItem", diff --git a/packages/calcite-components/src/components/pagination/pagination.tsx b/packages/calcite-components/src/components/pagination/pagination.tsx index a9d14f30463..065494c37ff 100644 --- a/packages/calcite-components/src/components/pagination/pagination.tsx +++ b/packages/calcite-components/src/components/pagination/pagination.tsx @@ -97,7 +97,7 @@ export class Pagination extends LitElement { @property({ reflect: true }) startItem = 1; /** Specifies the total number of items. */ - @property({ reflect: true }) totalItems = 1; + @property({ reflect: true }) totalItems = 0; //#endregion @@ -221,10 +221,8 @@ export class Pagination extends LitElement { //#region Private Methods private handleTotalPages(): void { - if (this.pageSize < 1) { - this.pageSize = 1; - } - this.totalPages = this.totalItems / this.pageSize; + this.pageSize = Math.max(1, this.pageSize); + this.totalPages = Math.max(1, this.totalItems / this.pageSize); } private effectiveLocaleChange(): void {