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

DOM appears to be held in memory in certain conditions with components rather than be destroyed #1593

Closed
imjoshdean opened this Issue Apr 2, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@imjoshdean
Contributor

imjoshdean commented Apr 2, 2015

I'm still struggling to come up with an easy way to succinctly describe this one. In short I have the following example:

http://jsbin.com/qiziqedage/1/edit?js,console,output

Flattened out, it looks something like this:

{{#if show}}
<layout>
    {{#if state.inner}}
        <internal></internal>
    {{/if}}
</layout>
{{/if}}

where show is a boolean compute and state.inner is a can.Map inside of a can.Map.

If I were to set show to false and remove inner from state, events trigger on internal, specifically in this case removed. If I were to set show to true, add inner back to state, and repeat the process, events trigger on internal twice, again, in this case removed. Inspecting this.element and working your way up the parent tree, you'll find that in all cases except one, the element is attached to a detached layout element.

Not even sure where to begin with this one, but I'll get a test and pull request ready.

imjoshdean added a commit that referenced this issue Apr 2, 2015

@daffl daffl added this to the 2.2.3 milestone Apr 2, 2015

@daffl daffl added the bug label Apr 2, 2015

@daffl daffl modified the milestones: 2.2.4, 2.2.3 Apr 2, 2015

justinbmeyer added a commit that referenced this issue Apr 3, 2015

make stache take a nodeList as a 3rd argument, have a component give …
…its template a nodeList that is tied to the component's lifecycle for #1593

@daffl daffl modified the milestones: 2.2.3, 2.2.4 Apr 3, 2015

imjoshdean added a commit that referenced this issue Apr 3, 2015

justinbmeyer added a commit that referenced this issue Apr 3, 2015

make stache take a nodeList as a 3rd argument, have a component give …
…its template a nodeList that is tied to the component's lifecycle for #1593

@daffl daffl closed this in #1594 Apr 3, 2015

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