Skip to content

Commit

Permalink
fix: register layout child for nested custom components (#7230)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-abs authored and manoldonev committed Jun 3, 2019
1 parent 4d6733d commit 3604df8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export * from "../layout-base";

function validateArgs(element: View): View {
if (!element) {
throw new Error("element cannot be null or undefinied.");
throw new Error("element cannot be null or undefined.");
}
return element;
}
Expand Down Expand Up @@ -291,7 +291,7 @@ export class GridLayoutBase extends LayoutBase implements GridLayoutDefinition {
}

protected invalidate(): void {
// handled natively in android and overriden in ios.
// handled natively in android and overridden in ios.
}

set rows(value: string) {
Expand Down
4 changes: 4 additions & 0 deletions tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export class GridLayout extends GridLayoutBase {

this.eachLayoutChild((child, last) => {
let measureSpecs = this.map.get(child);
if (!measureSpecs) {
return;
}

this.updateMeasureSpecs(child, measureSpecs);
this.helper.addMeasureSpec(measureSpecs);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ export class ProxyViewContainer extends LayoutBase implements ProxyViewContainer
const oldLayout = <LayoutBase>oldParent;

if (addingToParent && newLayout instanceof LayoutBase) {
this.eachChildView((child) => {
this.eachLayoutChild((child) => {
newLayout._registerLayoutChild(child);
return true;
});
} else if (oldLayout instanceof LayoutBase) {
this.eachChildView((child) => {
this.eachLayoutChild((child) => {
oldLayout._unregisterLayoutChild(child);
return true;
});
Expand Down

0 comments on commit 3604df8

Please sign in to comment.