mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
fix: register layout child for nested custom components (#7230)
This commit is contained in:

committed by
Manol Donev

parent
a345a14a8b
commit
888fc5740f
@ -5,7 +5,7 @@ export * from "../layout-base";
|
|||||||
|
|
||||||
function validateArgs(element: View): View {
|
function validateArgs(element: View): View {
|
||||||
if (!element) {
|
if (!element) {
|
||||||
throw new Error("element cannot be null or undefinied.");
|
throw new Error("element cannot be null or undefined.");
|
||||||
}
|
}
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
@ -291,7 +291,7 @@ export class GridLayoutBase extends LayoutBase implements GridLayoutDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected invalidate(): void {
|
protected invalidate(): void {
|
||||||
// handled natively in android and overriden in ios.
|
// handled natively in android and overridden in ios.
|
||||||
}
|
}
|
||||||
|
|
||||||
set rows(value: string) {
|
set rows(value: string) {
|
||||||
|
@ -136,6 +136,10 @@ export class GridLayout extends GridLayoutBase {
|
|||||||
|
|
||||||
this.eachLayoutChild((child, last) => {
|
this.eachLayoutChild((child, last) => {
|
||||||
let measureSpecs = this.map.get(child);
|
let measureSpecs = this.map.get(child);
|
||||||
|
if (!measureSpecs) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.updateMeasureSpecs(child, measureSpecs);
|
this.updateMeasureSpecs(child, measureSpecs);
|
||||||
this.helper.addMeasureSpec(measureSpecs);
|
this.helper.addMeasureSpec(measureSpecs);
|
||||||
});
|
});
|
||||||
|
@ -131,12 +131,12 @@ export class ProxyViewContainer extends LayoutBase implements ProxyViewContainer
|
|||||||
const oldLayout = <LayoutBase>oldParent;
|
const oldLayout = <LayoutBase>oldParent;
|
||||||
|
|
||||||
if (addingToParent && newLayout instanceof LayoutBase) {
|
if (addingToParent && newLayout instanceof LayoutBase) {
|
||||||
this.eachChildView((child) => {
|
this.eachLayoutChild((child) => {
|
||||||
newLayout._registerLayoutChild(child);
|
newLayout._registerLayoutChild(child);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
} else if (oldLayout instanceof LayoutBase) {
|
} else if (oldLayout instanceof LayoutBase) {
|
||||||
this.eachChildView((child) => {
|
this.eachLayoutChild((child) => {
|
||||||
oldLayout._unregisterLayoutChild(child);
|
oldLayout._unregisterLayoutChild(child);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user