cagov / design-system

State of California Design System
MIT License
79 stars 25 forks source link

Pagination display fix. @cagov/ds-pagination version 2.0.4 #1028

Closed jbum closed 2 months ago

jbum commented 2 months ago

This fixes a display issue with pagination buttons. The current code displays the following when there are 4 available pages.

CleanShot 2024-08-15 at 14 01 36

Notice that on page 1, Page 3 is mysteriously dropped. On Page 4, an ellipsis is displayed in place of a single page (ellipsis should only be used for 2 or more pages).

There are similar issues with 5 page, 6 page, and 7 page displays. Here is a 7 page display. CleanShot 2024-08-15 at 14 02 58 Notice that an ellipsis is shown in place of a single page, and page 6 is missing.

This patch shows the ellipsis in cases where it represents 2 or more pages, and shows a single page in its place, when it is appropriate to do, fixing all the above issues.

github-actions[bot] commented 2 months ago

Preview site available at jbum-pagination-patch.pr.designsystem.webstandards.ca.gov.

zakiya commented 2 months ago

@jon-grant-state-ca-gov @kkoryaka Can you review/comment/test/merge? We have some site updates that depend on it

zakiya commented 2 months ago

Just realized our contribution documentation is in a private Coda. Going to add them to this project's wiki. CDT folks you can determine what you want to do with them

zakiya commented 2 months ago

@jbum https://github.com/cagov/design-system/wiki/Publishing-design-system-components-to-npm-CDN