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

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 · Fixed by #1594
Labels
Milestone

Comments

@imjoshdean
Copy link
Contributor

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
…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
…its template a nodeList that is tied to the component's lifecycle for #1593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants