digipolisantwerp / antwerp-ui_angular

Antwerp UI is a component interface library for building user interfaces and responsive web apps.
https://digipolisantwerp.github.io/antwerp-ui_angular
MIT License
13 stars 19 forks source link

Pagination shows too many page numbers #144

Closed jsebrech closed 5 years ago

jsebrech commented 5 years ago

Describe the bug

When you have a lot of pages and you pass currentPage >= 5 as a string, the pagination renders with far too many number buttons.

The bug is introduced on this line: https://github.com/digipolisantwerp/acpaas-ui_angular/blob/master/packages/pagination/lib/src/pagination/components/pagination/pagination.component.ts#L69

When currentPage is a string, the slice command ends up converting to at least "5" + 1, or page 51.

Workaround

The application that renders the aui-pagination can pass currentPage as a number instead of a string. The bug does not occur in that case.

Screenshots

pagination-bug
TriangleJuice commented 5 years ago

Fixed by #145