Skip to content

Passing dynamic value to step prop in pagination no longer updates #7201

@britt6612

Description

@britt6612

Using Pagination component from grommet & passing the dynamic value(dropdown selection value) to the step prop. I see that when I change the step value using dropdown & pass it to Pagination component. The pagination page count is not getting changed.

Grommet added a step state than set that value within the PaginationStep so since I changed step from being directly assigned to stepProp to using useState it was only getting the initial value of stepProp during the initial render and was not updating

Expected Behavior

The pagination page count should change since the step value is changing

Actual Behavior

The pagination step prop is not being updated if we pass a dynamic value to Pagination step

URL, screen shot, or Codepen exhibiting the issue

https://codesandbox.io/p/sandbox/grommet-box-forked-ns453z?file=%2Fpackage.json%3A11%2C28

Steps to Reproduce

Your Environment

  • Grommet version: 2.36.1
  • Browser Name and version: chrome
  • Operating System and version (desktop or mobile):

Metadata

Metadata

Assignees

Labels

bugissue that does not match design or documentation and requires code changes to addressregressionAn issue reporting a regression or a PR that fixes a regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions