-
-
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
[Bug] On change of a {{each}}-looped array, Ember removes components elements from DOM but does not destroy components #19020
Comments
@gabrielgrant - This was fixed and released in 3.19.0, I think. |
Can you check? |
Ah, didn't even realize there was a 3.19 yet. Will do! Edit: ah, i see -- ember-cli 3.19 isn't cut yet, but ember proper is |
I filed #19033 which seems like it could be related to this, but my example shows leaking DOM nodes and memory with a very simple reproduction. It does not render any components in the loop. |
@gabrielgrant - Did you confirm if Ember 3.19 resolved this issue? |
Sorry, have had a few other things on my plate, so haven't gotten around to upgrading yet. Hopefully should be able to do so today or tomorrow |
Awesome, thank you. Please let us know, as I'd like to confirm that this is resolved or if we still need to debug... |
I can't tell if this is the same as what we fixed for #19033, that fix will be released in v3.20.1 shortly. |
@rwjblue Thanks for following up on this again, and sorry (again) for taking ages to get back to it. Adding Curious if you recall what issue this you'd guessed this was related to that was shipped in 3.19.0? (seems it wasn't #19033, since the fix was in 3.19) |
@gabrielgrant I think it was #18982 |
🐞 Describe the Bug
I have an
{{each}}
looping over an array and creating a component for each of the array entries. When the array changes for the second (and subsequent) times, Ember removes the DOM elements generated by the components but does not destroy components.The array is returned from getter which slices a larger array (so the returned arrays are unique per-retrieval). The entries of the larger array are unique objects.
🔬 Minimal Reproduction
Haven't yet come up with a minimal repro, but the problem can be observed with the following steps:
😕 Actual Behavior
After following the steps above, ember inspector shows:
RestaurantCard
components present, although only two appear in the DOM🤔 Expected Behavior
When the backing array changes, Components should both be removed from the DOM and destroyed
🌍 Environment
➕ Additional Context
This issue was originally reported on the ember-mapbox-gl repo. There's lots more info in that thread: kturney/ember-mapbox-gl#91
@kturney suggested it may have something to do with the complexity around
key
described inthis Ember issue, but I don't believe that's the case, for the reasons described in this comment: kturney/ember-mapbox-gl#91 (comment)
The text was updated successfully, but these errors were encountered: