Skip to content

fix(material/table): data not being re-rendered when sortingDataAccessor is changed #15922

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crisbeto
Copy link
Member

Fixes the table's data not re-rendering when a new sortingDataAccessor is assigned to the data source.

Fixes #15888.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Apr 27, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 27, 2019
@crisbeto crisbeto force-pushed the 15888/sorting-data-accessor-change branch from a328285 to 51eadf7 Compare April 27, 2019 17:02
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 30, 2019
andrewseguin
andrewseguin previously approved these changes Jul 20, 2020
@andrewseguin andrewseguin added lgtm action: merge The PR is ready for merge by the caretaker labels Jul 20, 2020
@mmalerba mmalerba removed the lgtm label Jul 31, 2020
@nvaralakshmi
Copy link

@crisbeto It looks like this PR is outdated, please rebase the PR.

@andrewseguin andrewseguin added needs rebase and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Dec 29, 2021
@crisbeto crisbeto changed the title fix(table): data not being re-rendered when sortingDataAccessor is changed fix(material/table): data not being re-rendered when sortingDataAccessor is changed Feb 28, 2022
@crisbeto crisbeto force-pushed the 15888/sorting-data-accessor-change branch from 51eadf7 to b2da9fa Compare February 28, 2022 06:30
@crisbeto crisbeto requested a review from a team as a code owner February 28, 2022 06:30
@crisbeto crisbeto added target: major This PR is targeted for the next major release and removed needs rebase target: patch This PR is targeted for the next patch release labels Feb 28, 2022
@crisbeto crisbeto force-pushed the 15888/sorting-data-accessor-change branch 2 times, most recently from 6e38a9f to d68145c Compare February 28, 2022 09:40
@crisbeto crisbeto added presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged needs: discussion Further discussion with the team is needed before proceeding and removed action: merge The PR is ready for merge by the caretaker labels Feb 28, 2022
@crisbeto crisbeto force-pushed the 15888/sorting-data-accessor-change branch from d68145c to c31cdb9 Compare February 28, 2022 09:54
…sor is changed

Fixes the table's data not re-rendering when a new `sortingDataAccessor` is assigned to the data source.

Fixes angular#15888.
@crisbeto crisbeto force-pushed the 15888/sorting-data-accessor-change branch from c31cdb9 to 7069b44 Compare February 28, 2022 10:00
@crisbeto
Copy link
Member Author

I spent some time trying to get this to pass all the internal checks, but it appears to be more breaking than I was expecting. The problem is that changing the sortDataAccessor to a getter/setter causes compilation errors for apps that do something like this:

class MyDataSource extends MatTableDataSource {
  override sortDataAccessor = customSortDataAccessor;
}

I tried working around it with the defineProperty call, but it ended up causing other issues. We should discuss whether it's worth the effort to continue with this change.

@josephperrott josephperrott removed the request for review from a team March 1, 2022 16:33
@andrewseguin andrewseguin removed their assignment Mar 24, 2022
@andrewseguin andrewseguin removed the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Mar 28, 2022
@josephperrott josephperrott requested a review from a team as a code owner December 18, 2024 17:40
@josephperrott josephperrott requested review from amysorto and mmalerba and removed request for a team December 18, 2024 17:40
@mmalerba mmalerba removed their request for review February 19, 2025 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: discussion Further discussion with the team is needed before proceeding presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MatTableDataSource.sortingDataAccessor does not work if assigned after "sort"
7 participants