-
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
fix(cdk-experimental/column-resize): Ensure resizable entity is not d… #24007
Conversation
…estroyed before applying min/max update The styleSchedule.scheduleEnd() function will sometimes call the provided callback after the nativeElement has been destroyed. The width of this nativeElement is used in the _apply(Min/Max)WidthPx functions to calculate a width diff. If the nativeElement has already been destroyed, the "current" width of the element is 0 so the column effectively doubles in width even though it technically didn't change. This width change is propagated up to the table which increases its size to account for the increased column width. If the element has been destroyed, we can just ignore any resize logic pertaining to that old column since it should no longer affect the table's width. A newer version of that entity should make the change if necessary.
Changes LGTM. Is it possible to capture this in a unit test? |
I don't think a unit test is possible unless we have some mechanism to mock the styleScheduler (which I don't see). Otherwise we can't effectively control when the scheduleEnd() callback will be called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…estroyed before applying min/max update (#24007) The styleSchedule.scheduleEnd() function will sometimes call the provided callback after the nativeElement has been destroyed. The width of this nativeElement is used in the _apply(Min/Max)WidthPx functions to calculate a width diff. If the nativeElement has already been destroyed, the "current" width of the element is 0 so the column effectively doubles in width even though it technically didn't change. This width change is propagated up to the table which increases its size to account for the increased column width. If the element has been destroyed, we can just ignore any resize logic pertaining to that old column since it should no longer affect the table's width. A newer version of that entity should make the change if necessary. (cherry picked from commit 35cdf7c)
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. |
…estroyed before applying min/max update
The styleSchedule.scheduleEnd() function will sometimes call the provided callback after the nativeElement has been destroyed. The width of this nativeElement is used in the _apply(Min/Max)WidthPx functions to calculate a width diff. If the nativeElement has already been destroyed, the "current" width of the element is 0 so the column effectively doubles in width even though it technically didn't change. This width change is propagated up to the table which increases its size to account for the increased column width.
If the element has been destroyed, we can just ignore any resize logic pertaining to that old column since it should no longer affect the table's width. A newer version of that entity should make the change if necessary.
See internal ticket b/207484257 for before/after screenshots of this change.