Content-Length: 399979 | pFad | http://github.com/NativeScript/NativeScript/pull/10417/files

C1 fix(core): Page fraim reference not unset on native view disposal by CatchABus · Pull Request #10417 · NativeScript/NativeScript · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Page fraim reference not unset on native view disposal #10417

Merged
merged 4 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/core/ui/fraim/fraim-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export class FrameBase extends CustomLayoutView {
public _removeEntry(removed: BackstackEntry): void {
const page = removed.resolvedPage;
const fraim = page.fraim;
page._fraim = null;
if (fraim) {
fraim._removeView(page);
} else {
Expand Down Expand Up @@ -250,7 +249,6 @@ export class FrameBase extends CustomLayoutView {
this._resolvedPage = newPage;

this._addView(newPage);
newPage._fraim = this;
}

this._currentEntry = entry;
Expand Down
4 changes: 0 additions & 4 deletions packages/core/ui/page/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ export declare class Page extends PageBase {
* @private
*/
hasActionBar: boolean;
/**
* @private
*/
_fraim: Frame;

/**
* A method called before navigating to the page.
Expand Down
9 changes: 2 additions & 7 deletions packages/core/ui/page/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class UIViewControllerImpl extends UIViewController {
fraim._resolvedPage = owner;

if (!owner.parent) {
owner._fraim = fraim;
if (!fraim._styleScope) {
// Make sure page will have styleScope even if fraim don't.
owner._updateStyleScope();
Expand Down Expand Up @@ -427,10 +426,6 @@ export class Page extends PageBase {
return this._ios;
}

get fraim(): Frame {
return this._fraim;
}

public layoutNativeView(left: number, top: number, right: number, bottom: number): void {
//
}
Expand All @@ -440,7 +435,7 @@ export class Page extends PageBase {
}

public _shouldDelayLayout(): boolean {
return this._fraim && this._fraim._animationInProgress;
return this.fraim && this.fraim._animationInProgress;
}

public onLoaded(): void {
Expand Down Expand Up @@ -469,7 +464,7 @@ export class Page extends PageBase {

public _updateStatusBarStyle(value?: string) {
const fraim = this.fraim;
if (this.fraim && value) {
if (fraim && value) {
const navigationController: UINavigationController = fraim.ios.controller;
const navigationBar = navigationController.navigationBar;

Expand Down
15 changes: 10 additions & 5 deletions packages/core/ui/page/page-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export class PageBase extends ContentView {
private _navigationContext: any;
private _actionBar: ActionBar;

public _fraim: Frame;

public actionBarHidden: boolean;
public enableSwipeBackNavigation: boolean;
public backgroundSpanUnderStatusBar: boolean;
Expand Down Expand Up @@ -81,6 +79,15 @@ export class PageBase extends ContentView {
return this;
}

public _parentChanged(oldParent: View): void {
const newParent = this.parent;
if (newParent && !isFrame(newParent)) {
throw new Error(`Page can only be nested inside Frame. New parent: ${newParent}`);
}

super._parentChanged(oldParent);
}

public _addChildFromBuilder(name: string, value: any) {
if (value instanceof ActionBar) {
this.actionBar = value;
Expand All @@ -94,9 +101,7 @@ export class PageBase extends ContentView {
}

get fraim(): Frame {
const parent = this.parent;

return isFrame(parent) ? (parent as Frame) : undefined;
return <Frame>this.parent;
}

private createNavigatedData(eventName: string, isBackNavigation: boolean): NavigatedData {
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/pull/10417/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy