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

Ellipsis showed between the first and the second page when visiting the fourth page #1166

Closed
dbsima opened this issue Dec 28, 2016 · 2 comments

Comments

@dbsima
Copy link

dbsima commented Dec 28, 2016

Bug description: Ellipsis showed between the first and the second page when visiting the fourth page

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/OTUONXeZSAEN0HRztpwb?p=preview

Click on the fourth page.

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.0.0

ng-bootstrap: 1.0.0-alpha.15

Bootstrap: 4.0.0-alpha.5
ss

@pkozlowski-opensource
Copy link
Member

I believe that it works as expected. You are saying: show me 5 pages and rotate. We do display 1 and 12 always. Dropping ellipsis between 1 and 2 would mean that all of the sudden we would be displaying 6 pages instead of 5.

I understand that it might look odd but I'm not sure it will be easy to come up with another consistent behaviour. We could:

  • stop showing 1 and 12
  • stop showing elipsis when there is continuity (then again, we are not respecting 5 pages).

Also you can drop [rotate]="true".

All in all it is a corner case and I'm not sure what would be the best way of changing it (not even sure if we want to change it at all). @maxokorokov WDYT?

@maxokorokov
Copy link
Member

Well yes, it is kinda working as expected for now, because we didn't take much time discussing corner cases. @pkozlowski-opensource, both your bullet points are implemented in the ui-bootstrap though:

  • there is a boundary-links-numbers option in the ui bootstrap to toggle 1 and 12
  • 5 page rotation is not respected

Dropping boundary number looks strange to me personally: ... 2 3 [4] 5 6 ... 12
So If we want to do something with it, I would probably just drop the ellipsis:

// for 12 pages
1  2 [3] 4  5  ...  12
1  2  3 [4] 5  6  ...  12   <--- 5-page rotation not respected
1 ... 3  4 [5] 6  7  ...  12

// for 7 pages for instance, 5-page rotation would never respected
1  2 [3] 4  5  6  7
1  2  3 [4] 5  6  7
1  2  3  4 [5] 6  7

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

No branches or pull requests

3 participants