-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
MatTableDataSource with Pagination does not update with data change less than paginator's index #14010
Labels
P2
The issue is important to a large percentage of users, with a workaround
Comments
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Dec 28, 2018
…than the current page Fixes the table not rendering correctly when going from a large set of data (e.g. 50 items and on page 10) to a small set of items (e.g. 1 item). The issue comes from the fact that the paginator doesn't emit events if they weren't generated by the user (see discussion on angular#12586). Fixes angular#14010.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Dec 28, 2018
…than the current page Fixes the table not rendering correctly when going from a large set of data (e.g. 50 items and on page 10) to a small set of items (e.g. 1 item). The issue comes from the fact that the paginator doesn't emit events if they weren't generated by the user (see discussion on angular#12586). Fixes angular#14010.
vivian-hu-zz
pushed a commit
that referenced
this issue
Jan 16, 2019
…than the current page (#14665) Fixes the table not rendering correctly when going from a large set of data (e.g. 50 items and on page 10) to a small set of items (e.g. 1 item). The issue comes from the fact that the paginator doesn't emit events if they weren't generated by the user (see discussion on #12586). Fixes #14010.
s2-abdo
pushed a commit
to s2-abdo/material2
that referenced
this issue
Jan 18, 2019
…than the current page (angular#14665) Fixes the table not rendering correctly when going from a large set of data (e.g. 50 items and on page 10) to a small set of items (e.g. 1 item). The issue comes from the fact that the paginator doesn't emit events if they weren't generated by the user (see discussion on angular#12586). Fixes angular#14010.
s2-abdo
pushed a commit
to s2-abdo/material2
that referenced
this issue
Jan 18, 2019
…than the current page (angular#14665) Fixes the table not rendering correctly when going from a large set of data (e.g. 50 items and on page 10) to a small set of items (e.g. 1 item). The issue comes from the fact that the paginator doesn't emit events if they weren't generated by the user (see discussion on angular#12586). Fixes angular#14010.
vivian-hu-zz
pushed a commit
that referenced
this issue
Jan 18, 2019
…than the current page (#14665) Fixes the table not rendering correctly when going from a large set of data (e.g. 50 items and on page 10) to a small set of items (e.g. 1 item). The issue comes from the fact that the paginator doesn't emit events if they weren't generated by the user (see discussion on #12586). Fixes #14010.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug, feature request, or proposal:
Bug
What is the expected behavior?
If you change the MatTableDataSource's data to a smaller set and the paginator is on a page further than the new data's length, the data should be shown with the updated paginator.
What is the current behavior?
When you change the datasource's data to a smaller set than the paginator's index, the index updates but the data is not shown until the you change the paginator to a different page size.
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
https://stackblitz.com/edit/angular-chekxx
What is the use-case or motivation for changing an existing behavior?
To be able to use the default datasource when the data it is using may change.
Is there anything else we should know?
Looking at the source code, it seems the data source's _updatePaginator function is wrapped with a promise. This seems to cause the paginator's index to update after the _pageData function already resolves, making the paginator update while the _pageData function uses the old index to filter the data.
The text was updated successfully, but these errors were encountered: