kobaltedev / kobalte

A UI toolkit for building accessible web apps and design systems with SolidJS.
https://kobalte.dev
MIT License
1.23k stars 63 forks source link

Fix fixed items pagination #464

Closed madaxen86 closed 3 weeks ago

madaxen86 commented 1 month ago

Added a fix for the case when paginations has fixedItems and the count is "small" which lead to

negative previousSibling pages higher nextSibling pages than count Added to render the pages directly if there's no need to render an ellipsis, because it would only replace one page. All test still pass.

Side note: I converted the signals and createEffect to a single createMemo to avoid endless update loops. Ryan Carniato once said in one of his talks that you should never set a signal from within createEffect and that it usually can be converted to a computed value (createMemo, createComputed,...) instead.

Feel free to reach out and discuss. Spent a whole day, to figure it out. In the end it was so simple 😅

Closes: Issue 461

netlify[bot] commented 1 month ago

Deploy Preview for kobalte ready!

Name Link
Latest commit 89c003e2235f83fd6f20b99ce18a13de155348f4
Latest deploy log https://app.netlify.com/sites/kobalte/deploys/66c63ba5f880ae00083670eb
Deploy Preview https://deploy-preview-464--kobalte.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

madaxen86 commented 4 weeks ago

Made biome to format and lint and made minor change to pagination-items.tsx also added changeset to PR

madaxen86 commented 4 weeks ago

Added another commit which replaces the ellipsis if it would replace only one pagination item.

jer3m01 commented 3 weeks ago

Thanks for the fix!

madaxen86 commented 3 weeks ago

Thanks for the fix!

You're welcome. But the changes don't show up on the npm package. Should I have changed the version in the package.json?

jer3m01 commented 3 weeks ago

But the changes don't show up on the npm package. Should I have changed the version in the package.json?

Haven't released an update yet, will take care of it soon.