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

Angular 4.x regression with embedded view handling #15352

Closed
pkozlowski-opensource opened this issue Mar 21, 2017 · 7 comments
Closed

Angular 4.x regression with embedded view handling #15352

pkozlowski-opensource opened this issue Mar 21, 2017 · 7 comments
Assignees
Labels
area: core Issues related to the framework runtime regression Indicates than the issue relates to something that worked in a previous version

Comments

@pkozlowski-opensource
Copy link
Member

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting

Minimal reproduction of the problem with instructions

This was discovered when switching ng-bootstrap to Angular 4 rc.5. Here is a plunker that works with the latest 2.3.x but fails when switching to Angular 4 rc.5:

http://plnkr.co/edit/Ha2UMEOc3pT2jUpg1Mjf?p=preview

Steps to reproduce:

  • hover over stars and mouseleave - see that the care comes back to the initial value
  • switch to 4.0.0-rc.5 in the config.js and repeat the scenario - see that with 4.0.0-rc.5 rating doesn't come back to the initial version on mouseleave

You can see the code for the rating directive here: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/rating/rating.ts

I'm working on a reduced reproduction scenario but wanted to open an issue ASAP as an "early warning". Currently my suspicion is that sth goes wrong when creating embedded views (or more precisely - refreshing them when context changes). I will provide a smaller reproduce as soon as I can narrow it down.

  • Angular version: 2.0.X

4.0.0-rc.5

  • Browser:

all

  • Language:

TypeScript

@vicb
Copy link
Contributor

vicb commented Mar 21, 2017

expected vs observed behavior ?

@pkozlowski-opensource
Copy link
Member Author

pkozlowski-opensource commented Mar 21, 2017

expected vs observed behavior ?

Observed: using 4.0.0-rc.5 when you hover over stars (mouseenter and mouseleve without click) the highlighted rating comes doesn't come back to the initial;

Expected: hovering overs stars without clicking should display initial rating on mouseleve.

@vicb sorry for not having a smaller reproduce scenario atm, I'm trying to isolate it as we speak. What I'm seeing is that refreshing a property on a context passed to an embedded template doesn't refresh the template bindings. But in ratings there are multiple levels of embedded views involved so I'm trying to come up with a minimal reproduce.

In any case there is a scenario that used to work just fine in 2.4.x and fails in 4.x and we are not doing anything too crazy.

Let me try to reproduce it in a simpler way

@DzmitryShylovich
Copy link
Contributor

@pkozlowski-opensource have you tried without OnPush?

@pkozlowski-opensource
Copy link
Member Author

@vicb here is a minimal plunker: http://plnkr.co/edit/eJ8XjQJHeZyFzvLDWV64?p=preview

Observed: clicking on a text node doesn't increment numbers

Expected: clicking on a text node increment numbers

@DzmitryShylovich good path: in fact this is a combination of a host listener + OnPush.

@vicb vicb added the regression Indicates than the issue relates to something that worked in a previous version label Mar 21, 2017
@tbosch tbosch added this to the 4.0.0-blocker-candidates milestone Mar 21, 2017
@tbosch tbosch added the area: core Issues related to the framework runtime label Mar 21, 2017
@tbosch tbosch self-assigned this Mar 21, 2017
tbosch added a commit to tbosch/angular that referenced this issue Mar 21, 2017
@tbosch
Copy link
Contributor

tbosch commented Mar 21, 2017

@pkozlowski-opensource could you try #15359?

@pkozlowski-opensource
Copy link
Member Author

@tbosch I can confirm that your PR #15359 fixes the issue: http://plnkr.co/edit/ZZK6szqSUvc7YnsknXfs?p=preview

Many thnx for looking into it and extremely fast turnaround on this one!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime regression Indicates than the issue relates to something that worked in a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants