-
-
Notifications
You must be signed in to change notification settings - Fork 76
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 fixed items pagination #464
Conversation
✅ Deploy Preview for kobalte ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…ngs count for low total count as no ellipses are necessary if the total count is lower than 2x siblingCount + boundaries and potential when items are fixed, we can just render only the count directly. fix kobaltedev#461
…more than one item - otherwise add item to corresponding sibling little refactor: simplified condition for renderItemsDirectly
Made biome to format and lint and made minor change to pagination-items.tsx |
Added another commit which replaces the ellipsis if it would replace only one pagination item. |
happened when last item of a page was removed - resulting in fewer pages and 'Invalid array length'
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? |
Haven't released an update yet, will take care of it soon. |
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