vmware-clarity / ng-clarity

Clarity Angular is a scalable, accessible, customizable, open-source design system built for Angular.
https://clarity.design
Other
317 stars 72 forks source link

clr-dg-pagination ignores initial value for clrDgPage #1466

Open derkoe opened 4 days ago

derkoe commented 4 days ago

Describe the bug

When you pass in an inital value for clrDgPage to clr-dg-pagination it gets ignored and "1" will be used.

We need to set the initial page of the grid to a certain value because we receive the page number from an URL parameter.

How to reproduce

Here is a Stackblitz project reproducing it: https://stackblitz.com/edit/clarity-light-theme-clr17-1f4jud

Steps to reproduce the behavior:

  1. Open the Stackblitz project
  2. See that the current page is set to "5" on the left but the pager shows "1"
  3. When you now page forward the page is set to "2"

image

Expected behavior

I would expect that the pager takes the initial value and starts paging from this value.

Versions

Clarity version:

Framework version:

Device:

All devices.

Additional notes

none

dtsanevmw commented 3 days ago

Hello,

Thanks for reporting! Order here matters so if you put the clrDgPageSize input before the page input it would work. That's happening due to page size being 0 by default and that's setting the page to 1. We'll log it internally and look forward that being more reactive.

Regards, Daniel Tsanev