question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change PageNavigator page number programmatically

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
emmenkocommented, Mar 30, 2021

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

1reaction
adnasacommented, Apr 7, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found