FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: register layout child for nested custom components (#7230) · NativeScript/NativeScript@3604df8 · GitHub

Commit 3604df8

Browse files
authored andcommitted
fix: register layout child for nested custom components (#7230)
1 parent 4d6733d commit 3604df8

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎tns-core-modules/ui/layouts/grid-layout/grid-layout-common.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export * from "../layout-base";
55

66
function validateArgs(element: View): View {
77
if (!element) {
8-
throw new Error("element cannot be null or undefinied.");
8+
throw new Error("element cannot be null or undefined.");
99
}
1010
return element;
1111
}
@@ -291,7 +291,7 @@ export class GridLayoutBase extends LayoutBase implements GridLayoutDefinition {
291291
}
292292

293293
protected invalidate(): void {
294-
// handled natively in android and overriden in ios.
294+
// handled natively in android and overridden in ios.
295295
}
296296

297297
set rows(value: string) {

‎tns-core-modules/ui/layouts/grid-layout/grid-layout.ios.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ export class GridLayout extends GridLayoutBase {
136136

137137
this.eachLayoutChild((child, last) => {
138138
let measureSpecs = this.map.get(child);
139+
if (!measureSpecs) {
140+
return;
141+
}
142+
139143
this.updateMeasureSpecs(child, measureSpecs);
140144
this.helper.addMeasureSpec(measureSpecs);
141145
});

‎tns-core-modules/ui/proxy-view-container/proxy-view-container.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ export class ProxyViewContainer extends LayoutBase implements ProxyViewContainer
131131
const oldLayout = <LayoutBase>oldParent;
132132

133133
if (addingToParent && newLayout instanceof LayoutBase) {
134-
this.eachChildView((child) => {
134+
this.eachLayoutChild((child) => {
135135
newLayout._registerLayoutChild(child);
136136
return true;
137137
});
138138
} else if (oldLayout instanceof LayoutBase) {
139-
this.eachChildView((child) => {
139+
this.eachLayoutChild((child) => {
140140
oldLayout._unregisterLayoutChild(child);
141141
return true;
142142
});

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL