-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[REGRESSION] On re-render, newly-added sub-views of non-dirty parent components have wrong parentView #11554
Comments
This has the same behavior in v2.0.0-beta.1 as in 1.13.2. |
I'm looking more into this. So far, I've found that this isn't |
…ents get the correct parentView On re-render of a non-dirty component, the `env` was simply passed down when rendering the component's template, which means its parentView was wrong; this patch mimics what keywords already do to solve this for components. Fixes emberjs#11554
I've put together a PR for this. It's a bit of a hack, and there's probably a nicer solution possible; feedback welcome. At least, there's a simple test case in there someone could reuse. The problem seems to come down to the fact that when a parent component is not dirty, HTMLBars never asks for it to generate an Perhaps the problem is that the env is not the right place to store this info in the first place? |
…ents get the correct parentView On re-render of a non-dirty component, the `env` was simply passed down when rendering the component's template, which means its parentView was wrong; this patch mimics what keywords already do to solve this for components. Fixes #11554 (cherry picked from commit bc9dbcd)
It appears that 1.13.0 through 1.13.2 have a bug relative to 1.12.2 in which newly-added items in an each loop get a
parentView
set to the template's view rather than the component in which they appear in the template. Here is a JS bin demonstrating the issue:http://jsbin.com/butavikavi/edit?html,js,console,output
Essentially, code like this:
The child components will have
parent-component
as their parentView, but on re-render if a newchild-component
appears, its parent view will be whatever view houses the template, not the parent-component.The text was updated successfully, but these errors were encountered: