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
In some cases pagination component hides only one page by ellipsis #1235
Comments
@pkozlowski-opensource if you think that it's a valid issue, I can fix it |
I'm conflicted about this change. Depends on what is more important: respecting the A dedicated flag for this should solve this for me, but for now I'm against adding it to the API :) So I would leave it as is. Example with a little more context:
5 pages' example: #1166 (comment) |
@maxokorokov Yeah, I understand that component is trying to respect "max size" parameter and shows only specified number of pages, but I'm not sure this behavior is better for an end user. In my mind, the more options user sees, the better. And showing "..." instead of one page doesn't improve UX. The same approach is implemented in angular-ui/bootstrap. I think there is a better option than respecting a number of items around current - it's respecting the total number of elements (buttons with page numbers or ellipsis) inside pagination. It's more useful because it makes a width of pagination more predictable than when the width is changing when you are on different pages. For example now for 10 pages and "maxSize"=3 case in ng-bootstrap we have:
As you can see, number of elements is changing from 5 to 7 and, as a result, the width of pagination is also changing. Here is an example of paginator that respects total number of elements (for the same configuration as described before it always shows 7 elements): http://ultimate-pagination.github.io/react-ultimate-pagination-examples/ The logic behind it is implemented as a separate framework-independent module: https://github.com/ultimate-pagination/ultimate-pagination And if you like this approach I would like to enhance |
@dmytroyarmak if you still up to improving the pagination component we would love to see a PR. I'm "buying" your reasoning that we should optimise for pagination's no of elements vs. no of shown pages. I would love to keep external dependencies to the minimum so we are not ready to bring in ultimate-pagination but if you could replicate the same behaviour in-here it would be awesome! |
Bug description:
There is a case when pagination component inserts ellipsis instead of just one page. I think it will be more useful for a user to show this page instead of the ellipsis.
For example for:
The current result is:
But maybe it will be better to show 9th page in this case. It will be the same number of elements:
The same problem happens on the 4th page.
Link to minimally-working plunker that reproduces the issue:
http://plnkr.co/edit/sbawSfKJcyIGBQFAC0JC?p=preview
Version of Angular, ng-bootstrap, and Bootstrap:
Angular: 2.0.0
ng-bootstrap: 1.0.0-alpha.18
Bootstrap: 4.0.0-alpha.6
The text was updated successfully, but these errors were encountered: