Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pagination): Show page number when there is only 1 page #1240

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Mukilan1600
Copy link

When there is only 1 page the page number is not shown, instead only the disabled buttons () are shown. The correct behavior is to show the active page number (1) and have the buttons disabled.

This is fixed by modifying the range functions implementation to return an array with a single number when start and end are equal, instead of an empty array. The change to range function doesn't break any other functionality.

fix #1048

Current:
image

Fixed:
image

When there is only 1 page the page number is not shown, instead only the disabled buttons are shown.
The correct behaviour is to show the active page number (1) and have the buttons disabled.

fix themesberg#1048
Copy link

vercel bot commented Jan 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2024 5:19am

Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7461173) 99.54% compared to head (9937616) 97.38%.
Report is 192 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1240      +/-   ##
==========================================
- Coverage   99.54%   97.38%   -2.17%     
==========================================
  Files         163      216      +53     
  Lines        6621     9217    +2596     
  Branches      401      538     +137     
==========================================
+ Hits         6591     8976    +2385     
- Misses         30      241     +211     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination is broken if there is only one page
1 participant