From ca0628f2dca7b315592199198dd4abf0c2fee1a8 Mon Sep 17 00:00:00 2001 From: Chris McCord Date: Tue, 8 Aug 2023 15:52:10 -0400 Subject: [PATCH] Fix --- assets/js/phoenix_live_view/dom_patch.js | 4 +++- assets/js/phoenix_live_view/rendered.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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) } }