Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(detached-loader): completely deatch components #2257

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

Merged
NathanWalker merged 2 commits into NativeScript:master from edusperoni:detached-loader-refactor
Sep 21, 2020

Conversation

@edusperoni
Copy link
Collaborator

@edusperoni edusperoni commented Sep 20, 2020

PR Checklist

What is the current behavior?

Detached Loader (DetachedContainer) creates components in place, attaching to a detached ProxyViewContainer and then moving the native views to their appropriate position:

Application
|----AppComponent
| |---------- Component1
| |---------- ListView1
| |---------- DetachedContainer (not actually added to the DOM!)
| |---------- ModalView/ListView item/etc (Ng view attached to DetachedContainer, native view attached to modal window/ListView1)

What is the new behavior?

Detached Loader will instantiate components without adding them to the DOM at all, but instead attaching the angular view to the ApplicationRef (enabling change detection). This also fixes issues where modals opened inside a OnPush component would not be CD.

This approach mimics the @angular/cdk approach (portals and DomPortalOutlet).

Application
|----AppComponent
| |---------- Component1
| |---------- ListView1
| |---------- DetachedContainer (not actually added to the DOM! Here for compatibility reasons)
|--- ModalView/ListView item/etc (native view attached to modal window/ListView1)

This doesn't fix the root cause of #2256, but should fix most of the issues until the root is fixed (createComponent function of ViewContainerRef).

Fixes #2256.

bellalMohamed reacted with thumbs up emoji bellalMohamed reacted with hooray emoji bellalMohamed reacted with heart emoji bellalMohamed reacted with rocket emoji
@NathanWalker NathanWalker merged commit 623d2f7 into NativeScript:master Sep 21, 2020
Copy link
Contributor

Just updated to 10.1.3 and tested, unfortunately it doesn't fix #2256 I'm still facing the same issue

Copy link
Contributor

@bellalMohamed that issue was closed by accident upon merging - 10.1.3 only fixes a modal binding issue as well as the ngIf ordering issue - we’re still investigating that final issue with navigation but anticipate it being solved by Tuesday.

bellalMohamed reacted with thumbs up emoji

Copy link
Contributor

@NathanWalker no worries, what do you think caused this issue?

Copy link
Collaborator Author

Turns out this is my bad. I forgot to handle the way the component is created using an external factory (

return this.containerRef.createComponent(factory, this.containerRef.length, this.containerRef.injector, null);
).

Oops.

I'll get to it first thing in the morning. The reason modal worked and navigation didn't is because navigation calls that function specifically to create pages.

NathanWalker and bellalMohamed reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Two-way data binding stops working after navigation on IOS

AltStyle によって変換されたページ (->オリジナル) /