diff --git a/assets/js/phoenix_live_view/dom_patch.js b/assets/js/phoenix_live_view/dom_patch.js index 9fc4c77348..c17a3eccf9 100644 --- a/assets/js/phoenix_live_view/dom_patch.js +++ b/assets/js/phoenix_live_view/dom_patch.js @@ -110,7 +110,9 @@ export default class DOMPatch { }) if(reset !== undefined){ DOM.all(container, `[${PHX_STREAM_REF}="${ref}"]`, child => { - this.removeStreamChildElement(child) + if(!inserts[child.id]){ + this.removeStreamChildElement(child) + } }) } deleteIds.forEach(id => { diff --git a/assets/js/phoenix_live_view/rendered.js b/assets/js/phoenix_live_view/rendered.js index e440156a07..cb58281404 100644 --- a/assets/js/phoenix_live_view/rendered.js +++ b/assets/js/phoenix_live_view/rendered.js @@ -186,6 +186,7 @@ export default class Rendered { if(stream !== undefined && (rendered[DYNAMICS].length > 0 || deleteIds.length > 0 || reset)){ delete rendered[STREAM] + rendered[DYNAMICS] = [] output.streams.add(stream) } }