Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: prevent overriding column hidden state when attaching column group (CP: 14.8) #2216

Merged
merged 2 commits into from
May 11, 2022

Conversation

sissbruecker
Copy link
Contributor

Fixes the column group to not synchronize its hidden state to child columns when it is attached, and visible.

Fixes vaadin/flow-components#2959
Cherry-pick of: vaadin/web-components#3805

…up (#3805) (CP: 14.8)

Fixes the column group to not synchronize its hidden state to child columns when it is attached, and visible.

Fixes vaadin/flow-components#2959
Cherry-pick of: vaadin/web-components#3805
Comment on lines -316 to -319
// no renderer or template needed in a hidden column
if (this.hidden) {
return;
}
Copy link
Contributor Author

@sissbruecker sissbruecker May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR seems to affect when the hidden state changes, so this condition was causing header templates not to render. The problem with this condition is that the observer does not listen to hidden changes, so even if the column / group becomes visible this is never called again. Adding hidden to the observer also didn't improve things, as there are some other checks that prevent setting the template.

The condition here was introduced as part of this bugfix: #2146. However it seems the fix was not covering all cases, so a another fix was added later: #2200. It seems that with the second fix the first one is not needed anymore, so it looks like we can remove it. The other concern is doing the extra work of rendering the cells even though they are hidden, though that was already the case before the first fix.

@sissbruecker sissbruecker requested a review from tomivirkki May 11, 2022 08:35
@sissbruecker sissbruecker merged commit 6b15346 into master May 11, 2022
@sissbruecker sissbruecker deleted the fix/column_hidden_override_14 branch May 11, 2022 09:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[grid] Hidden grouped columns are still shown when hiding them during initialization
2 participants