Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
285 stars 76 forks source link

Pagination with zero total-items shows `0` as first page #10275

Open nwhittaker opened 2 weeks ago

nwhittaker commented 2 weeks ago

Check existing issues

Actual Behavior

Screenshot 2024-09-11 at 4 30 10 PM

Given a <calcite-pagination> element with zero totalItems, the page button shows 0 and is not selected by default.

Screenshot 2024-09-11 at 4 49 17 PM

Interestingly, at very narrow viewport widths, the 1 button appears along with arrow buttons which can be used to fast forward to the 0 button.

Expected Behavior

Screenshot 2024-09-11 at 4 30 18 PM

The page button shows 1 and is selected by default.

Screenshot 2024-09-11 at 4 51 42 PM

It is not possible to navigate to the 0 button at narrow viewport widths.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/OJeqqyQ

Reproduction Steps

  1. Visit the repro and compare with the expected vs. actual behavior at standard and narrow viewport widths.

Reproduction Version

2.12.2

Relevant Info

No response

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

Extra consideration is required by the consumer to ensure the pagination component displays an empty state seamlessly.

Calcite package

Esri team

ArcGIS Field Apps

geospatialem commented 2 weeks ago

Consider if effort could be linked to https://github.com/Esri/calcite-design-system/issues/10276.