fix(core): make ProxyViewContainer.hidden hide child views (#10912)#10913
fix(core): make ProxyViewContainer.hidden hide child views (#10912)#10913KL2400040448 wants to merge 8 commits intoNativeScript:mainfrom
Conversation
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx test apps-automated -c=android |
❌ Failed | 9s | View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded | 3s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-11-05 19:14:37 UTC
|
|
|
We have hidden as well. The changes look accurate, had to adjust few things but it just ensures when using it on proxy that it’s children we marked hidden since proxy is not a native view itself. |
That's my bad, thanks for the correction @NathanWalker! |
|
@KL2400040448 @NathanWalker Instead of meddling with the property like this, maybe we can add an event listener for it. function onHiddenPropertyChange(args: EventData) {
const view = args.object as ProxyViewContainer;
view.eachChildView((child) => {
child.hidden = view.hidden;
return true;
});
}
@CSSType('ProxyViewContainer')
export class ProxyViewContainer extends LayoutBase {
private proxiedLayoutProperties = new Set<string>();
constructor() {
super();
this.nativeViewProtected = undefined;
this.on('hiddenProperty', onHiddenPropertyChange);
}
...
}This isn't as hackish as current solution and doesn't need ignore comments. |
6e2b60a to
73fc52c
Compare
|
✅ Rebased and resolved merge conflict. |
|
Hi @NathanWalker 👋 |
|
Hi @NathanWalker 👋 |
|
|
||
| /* | ||
| * Register/unregister existing children with the parent layout. | ||
| */ |
There was a problem hiding this comment.
Curious why valid comments removed?
|
|
||
| /** | ||
| * Layout property changed, proxy the new value to the child view(s) | ||
| */ |
|
|
||
| /** | ||
| * Apply the layout property to the child view. | ||
| */ |
| 'colSpan', | ||
| 'row', | ||
| 'rowSpan', | ||
| ]; |
There was a problem hiding this comment.
Same deal here. comments within are valid context.
| * removing children, so that they can update private measure data. | ||
| * | ||
| * We register our children with the parent to avoid breakage. | ||
| */ |
This PR fixes an issue where setting ProxyViewContainer.hidden = true did not hide its child views.
Problem
ProxyViewContainer is a virtual container that does not create a native view.
As a result, toggling its hidden property had no visible effect — its child views remained visible.
Solution
Override the hidden property to propagate the hidden state to all child views:
public set hidden(value: boolean) {
super.hidden = value;
this.eachChildView((child) => {
child.hidden = value;
return true;
});
}