Skip to content

bug(table): Table data does not get updated when paginator pageIndex is modified #26890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
mazhar-fis opened this issue Apr 6, 2023 · 2 comments · May be fixed by #30896
Open
1 task

bug(table): Table data does not get updated when paginator pageIndex is modified #26890

mazhar-fis opened this issue Apr 6, 2023 · 2 comments · May be fixed by #30896
Labels
area: material/paginator P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@mazhar-fis
Copy link

mazhar-fis commented Apr 6, 2023

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

On changing paginator's input property 'pageIndex', table content does not update.

Reproduction

Steps to reproduce:

  1. Create a table with paginator.
  2. Bind input property 'pageIndex' on paginator.
  3. increment the pageIndex property.
  4. Notice the table content. (Content remains on Page-1)
  5. Refresh the page.
  6. Click the next button of paginator.
  7. Notice the table content. (Content moves to Page-2)

Stackblitz: https://stackblitz.com/edit/angular-4h4jkr?file=src%2Fapp%2Ftable-overview-example.ts

Expected Behavior

When we use table with paginator and change page by:

  1. clicking next/previous button:
  • paginator state updates
  • table content updates
  1. Updating pageIndex property
  • paginator state updates
  • table content also should update

Actual Behavior

When we use table with paginator and change page by:

  1. clicking next/previous button:
  • paginator state updates
  • table content updates
  1. Updating pageIndex property
  • paginator state updates
  • table content does not update

Environment

  • Angular: 15.2.6
  • CDK/Material: 15.2.6
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@mazhar-fis mazhar-fis added the needs triage This issue needs to be triaged by the team label Apr 6, 2023
@siqiluo7
Copy link

siqiluo7 commented Apr 8, 2023

Which version was working for you? I checked 14.2.7, which is not working as well.

@mazhar-fis
Copy link
Author

It was never working for me from the start.

@wagnermaciel wagnermaciel added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/paginator and removed needs triage This issue needs to be triaged by the team labels Apr 10, 2023
siqiluo7 added a commit to siqiluo7/components that referenced this issue Apr 10, 2023
…or pageIndex is modified

Fixes a bug in the Angular Material `paginator` component where table data does not get updated when paginator pageIndex is modified via Input. This is because pageEvent is not fired when pageIndex changes.

Fixes angular#26890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/paginator P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
3 participants