Change PageNavigator page number programmatically
See original GitHub issueWhen changing the page number on PageNavigator programmatically, it dosent update the viewed page number
To Reproduce
<Pagination perPageRange="m" perPage={perPage} totalItems={totalOrders} page={page} onPageChange={pageChange} onPerPageChange={perPageChange} />
In another function, change ‘page’ to another value.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Programmatically Change Page #885 - mbrn/material-table
Is there any way to programmatically change the page, or set the current page asynchronously? When I programmatically set initialPage, ...
Read more >jQM navigating to page programmatically - Stack Overflow
I have this code: $("select.start").change(function() { alert('test'); $( ...
Read more >Changing the PAGE value programmatically
I've read a number of posts about using the PAGE field to change the displayed page number in a header or footer (e.g.,...
Read more >Interact programmatically with the Navigation component
On this page; Create a NavHostFragment; Reference a destination using NavBackStackEntry; Returning a result to the previous Destination.
Read more >Programmatically Number Pages - MATLAB & Simulink
These examples show how to number pages of a report programmatically with both the DOM and Report APIs. This workflow applies only to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, at the moment the
page
prop that you pass to the component is only used as the “initial” state value, therefore changing it won’t change the behavior of the internal pagination state.https://github.com/commercetools/ui-kit/blob/d91814718a7e569f0a3555dd2e3f0fa0371c60b8/packages/components/pagination/src/page-navigator/page-navigator.js#L17
This is what is causing this issue. I don’t see an issue of updating the internal
page
state according to the prop but we need to check and think about if there might be potential side effects.Thanks
hey @Tormand we released v11.3.0 some time ago where we addressed your concern https://github.com/commercetools/ui-kit/pull/1841
will you have a look, migrate and come back to us with feedback? Thanks in advance