Fix: ProxyViewContainer.hidden property now properly hides children#10939
Draft
VeinDevTtv wants to merge 7 commits intoNativeScript:mainfrom
Draft
Fix: ProxyViewContainer.hidden property now properly hides children#10939VeinDevTtv wants to merge 7 commits intoNativeScript:mainfrom
VeinDevTtv wants to merge 7 commits intoNativeScript:mainfrom
Conversation
- Add parsePositiveInt(JSONObject, String
- Added _applyHiddenToChildren method to propagate hidden state to all children - Overrode hiddenProperty for ProxyViewContainer to call _applyHiddenToChildren when value changes - Updated _addViewToNativeVisualTree to apply hidden state to new children when container is hidden - Preserves isCollapsed behavior for layout calculations Fixes NativeScript#10912
- Test hiding existing children when proxy.hidden = true - Test showing children when proxy.hidden = false - Test hiding new children added after setting hidden = true - Test multiple children scenarios Fixes NativeScript#10912
- Accept main branch improvements for parsePositiveInt method - Use doubleValue() with Math.floor() for better numeric parsing - Add null check with object.isNull(key) - Use specific JSONException instead of generic Exception - Add documentation comment for numeric coercion
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx test apps-automated -c=ios |
❌ Failed | 15s | View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded | 1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-11-12 07:06:19 UTC
- import booleanConverter instead of using hiddenProperty.valueConverter - expose _applyHiddenToChildren so property handler can invoke it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.