Fix: ProxyViewContainer.hidden property now properly hides children #10939
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
When
ProxyViewContainer.hidden = trueis set, the container'sisCollapsedproperty is set correctly for layout calculations, but the child views remain visible becauseProxyViewContainerhas no native view. Since children are directly added to the parent's native view tree, they need to have theirhiddenproperty set individually to be visually hidden.This is described in issue #10912.
What is the new behavior?
When
ProxyViewContainer.hidden = trueis set, the hidden state is now properly propagated to all child views, making them visually hidden. The fix:Added
_applyHiddenToChildrenmethod: Iterates through all child views and applies the hidden state to each one.Overrode
hiddenPropertyforProxyViewContainer: Registered a custom property handler that:isCollapsedfor layout calculations (preserving existing behavior)_applyHiddenToChildrento propagate the hidden state to all childrenUpdated
_addViewToNativeVisualTree: When a new child is added, if the container is already hidden, the child's hidden property is immediately set totrue.This ensures that when
ProxyViewContainer.hidden = trueis set, all existing and future children are properly hidden, matching the expected behavior.Fixes #10912.