Closed yuan-kuan closed 3 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it
This an attempt to fix #478
I suspect this is a regression caused by this commit: https://github.com/dart-lang/angular_components/commit/259039e1ee9ee540c581684e7b0cdae345dfa101. I found to this commit by going through the history to look for anything that affects change detection. And this is exactly something to do with that. Reverting these changes (removing the new lines added) will fix this issue.
Of course, I am not suggesting undoing these changes. I understand there was a warning about
ChangeDetection.OnPush
during the building of Angular web application since theangular 6.0.0
upgrade.So, I thought the correct way is to make
MaterialTreeNode
to be aware of the selection changes, and mark itself for check.I have tried to do this selection change detection in the parent component
MaterialTreeComponent
but failed to find a way to do it from there. So I resorted to do this detection in each tree node.I have see this fix in my own reproducing project: https://github.com/yuan-kuan/angulardart-broken-tree. And also the Angular Component Example project (I forked and cloned it and tested locally in my machine.)