tyler-technologies-oss / forge

Framework agnostic Web Component library that implements the Tyler Forge™ design system.
Apache License 2.0
47 stars 13 forks source link

[paginator] initializing `offset` before `total` does not adjust `pageSize` #400

Closed DRiFTy17 closed 1 year ago

DRiFTy17 commented 1 year ago

Describe the bug: When initializing values on the paginator for the first time (when total starts at 0 to >0 value), if setting the offset property prior to setting the total property, the pageSize will not be set. This is more obvious when using frameworks like Angular where the bindings could be set in any order and developers shouldn't have to worry about the order of their bindings...

To Reproduce: Steps to reproduce the behavior:

  1. Create a paginator using document.createElement('forge-paginator')
  2. Set the offset property on the new paginator instance to a value that matches the page size
  3. Set the total property to 100
  4. Append the paginator instance to the DOM
  5. See that the page size hasn't changed

Expected behavior: The offset value should be allowed to be set regardless of when total is set.

Please complete the following information:

Additional context: We may just need to check if offset is set to anything when total is set and recalculate the pageSize in the total setter as well to make sure that order doesn't matter.

github-actions[bot] commented 1 year ago

:rocket: Issue was released in v3.0.0-next.12 :rocket: