-
Notifications
You must be signed in to change notification settings - Fork 5.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
Blaze.remove doesn't remove DOM nodes when Blaze.renderWithData is used to create the template #3130
Comments
Slava
added a commit
that referenced
this issue
Dec 9, 2014
autogenerated parents those need to be gc'd with their children. Should help with #3130
Hi @davidworkman9, thanks for this report and a very clear reproduction. I submitted a fix in #3261, waiting for a review from the Blaze team :) |
Thanks :) |
dgreensp
added a commit
that referenced
this issue
Dec 9, 2014
If you Blaze.remove a View that is a template rendered by Blaze.renderWithData, or included with an implicit “with” as in `{{> myTemplate someData}}`, Blaze will now remove the DOM of the template, and also remove the implicit “with” (in both cases). As background, Blaze.remove only works on Views that were attached directly under a DOM element, not inside another View. Blaze.render always attaches the resulting View directly under a DOM element, but Blaze.renderWithData creates a “with” View around the template View. Previously, you could Blaze.remove the “with” View (which is returned by renderWithData), but if you got access to the template’s View some other way and tried to remove it directly, nothing would happen. Now, the correct thing happens (the View is destroyed and the DOM is removed). In the future, we should consider whether Blaze.remove should work on arbitrary Views, not just Views attached under a DOM element.
Fixed on |
martijnwalraven
pushed a commit
that referenced
this issue
Feb 22, 2016
autogenerated parents those need to be gc'd with their children. Should help with #3130
martijnwalraven
pushed a commit
that referenced
this issue
Feb 22, 2016
If you Blaze.remove a View that is a template rendered by Blaze.renderWithData, or included with an implicit “with” as in `{{> myTemplate someData}}`, Blaze will now remove the DOM of the template, and also remove the implicit “with” (in both cases). As background, Blaze.remove only works on Views that were attached directly under a DOM element, not inside another View. Blaze.render always attaches the resulting View directly under a DOM element, but Blaze.renderWithData creates a “with” View around the template View. Previously, you could Blaze.remove the “with” View (which is returned by renderWithData), but if you got access to the template’s View some other way and tried to remove it directly, nothing would happen. Now, the correct thing happens (the View is destroyed and the DOM is removed). In the future, we should consider whether Blaze.remove should work on arbitrary Views, not just Views attached under a DOM element.
martijnwalraven
pushed a commit
that referenced
this issue
Feb 22, 2016
martijnwalraven
pushed a commit
that referenced
this issue
Feb 22, 2016
If you Blaze.remove a View that is a template rendered by Blaze.renderWithData, or included with an implicit “with” as in `{{> myTemplate someData}}`, Blaze will now remove the DOM of the template, and also remove the implicit “with” (in both cases). As background, Blaze.remove only works on Views that were attached directly under a DOM element, not inside another View. Blaze.render always attaches the resulting View directly under a DOM element, but Blaze.renderWithData creates a “with” View around the template View. Previously, you could Blaze.remove the “with” View (which is returned by renderWithData), but if you got access to the template’s View some other way and tried to remove it directly, nothing would happen. Now, the correct thing happens (the View is destroyed and the DOM is removed). In the future, we should consider whether Blaze.remove should work on arbitrary Views, not just Views attached under a DOM element.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction here
The text was updated successfully, but these errors were encountered: