← 返回首页
Fix: ProxyViewContainer.hidden property now properly hides children by VeinDevTtv · Pull Request #10939 · NativeScript/NativeScript · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Fix: ProxyViewContainer.hidden property now properly hides children#10939

Draft
VeinDevTtv wants to merge 7 commits into
NativeScript:mainfrom
VeinDevTtv:fix/proxy-view-container-hidden-property
Draft

Fix: ProxyViewContainer.hidden property now properly hides children#10939
VeinDevTtv wants to merge 7 commits into
NativeScript:mainfrom
VeinDevTtv:fix/proxy-view-container-hidden-property

Conversation

VeinDevTtv commented Nov 5, 2025
edited
Loading

Copy link
Copy Markdown
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 Bot commented Nov 6, 2025
edited
Loading

Copy link
Copy Markdown

🤖 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 marked this pull request as draft November 8, 2025 06:31
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property of hidden does not work in ProxyViewContainer

2 participants

Footer

© 2026 GitHub, Inc.