Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@VeinDevTtv
Copy link
Contributor

PR Checklist

What is the current behavior?

When ProxyViewContainer.hidden = true is set, the container's isCollapsed property is set correctly for layout calculations, but the child views remain visible because ProxyViewContainer has no native view. Since children are directly added to the parent's native view tree, they need to have their hidden property set individually to be visually hidden.

This is described in issue #10912.

What is the new behavior?

When ProxyViewContainer.hidden = true is set, the hidden state is now properly propagated to all child views, making them visually hidden. The fix:

  1. Added _applyHiddenToChildren method: Iterates through all child views and applies the hidden state to each one.

  2. Overrode hiddenProperty for ProxyViewContainer: Registered a custom property handler that:

    • Sets isCollapsed for layout calculations (preserving existing behavior)
    • Calls _applyHiddenToChildren to propagate the hidden state to all children
  3. Updated _addViewToNativeVisualTree: When a new child is added, if the container is already hidden, the child's hidden property is immediately set to true.

This ensures that when ProxyViewContainer.hidden = true is set, all existing and future children are properly hidden, matching the expected behavior.

Fixes #10912.

- 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
@nx-cloud
Copy link

nx-cloud bot commented Nov 6, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit d1a2385

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

VeinDevTtv and others added 2 commits November 6, 2025 15:37
- import booleanConverter instead of using hiddenProperty.valueConverter
- expose _applyHiddenToChildren so property handler can invoke it
@VeinDevTtv VeinDevTtv marked this pull request as draft November 8, 2025 06:31
@NathanWalker NathanWalker added this to the 9.0.1 milestone Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property of hidden does not work in ProxyViewContainer

2 participants