digipolisantwerp/antwerp-ui_angular

Pagination shows too many page numbers

Closed this issue · 1 comments

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

Fixed by #145