Skip to content

fix(material/tree): not rendering initial data from flat data source #22340

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

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

crisbeto
Copy link
Member

The MatTreeFlatDataSource has an initialData parameter which doesn't work, because it only assigns the data to one of the three streams used to render the tree.

These changes also make some underscored properties private.

Fixes #22282.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Mar 25, 2021
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 25, 2021
@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Mar 25, 2021
@wagnermaciel
Copy link
Contributor

_flattenedData is used internally in ~10 files, so making it private is a breaking change

@andrewseguin what is the standard response to people using fake private props? Isn't this discouraged & not supported?

@crisbeto crisbeto force-pushed the 22282/tree-initial-data branch from 2693a46 to 94df9fb Compare March 29, 2021 06:10
@crisbeto
Copy link
Member Author

I've made it public again. Usually the underscore prefix means that it's private so it should discourage people from using it, but there's nothing actually stopping them from doing it.

@andrewseguin
Copy link
Contributor

Yeah...they should not have been using it but unless we put private then we can't do much about it. If we want, we can modify their code based on what they are trying to achieve. Also, if their uses are legit, maybe we consider making it public (without underscore)

@wagnermaciel
Copy link
Contributor

@andrewseguin My thoughts exactly. I know literally nothing about the angular material tree, but is there another way to access the _flattenedData other than the property? Also, I've sent you a few links to some places where _flattenedData is being used in g3

@crisbeto crisbeto force-pushed the 22282/tree-initial-data branch from 94df9fb to 750ee4e Compare March 30, 2021 15:59
@wagnermaciel
Copy link
Contributor

@crisbeto I think we should be good to land this internally but there are some merge conflicts that need to be resolved before I can run presubmits

The `MatTreeFlatDataSource` has an `initialData` parameter which doesn't work, because it only assigns the data to one of the three streams used to render the tree.

These changes also make some underscored properties private.

Fixes angular#22282.
@crisbeto
Copy link
Member Author

crisbeto commented Apr 7, 2021

Done.

@crisbeto crisbeto force-pushed the 22282/tree-initial-data branch from 750ee4e to 29f7eee Compare April 7, 2021 14:34
@mmalerba mmalerba added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Apr 8, 2021
@mmalerba mmalerba merged commit fa7ed4c into angular:master Apr 8, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(tree): tree does not initialize when data is set in constructor
5 participants