Skip to content

Commit

Permalink
reorder live components that are direct stream childs (#2982)
Browse files Browse the repository at this point in the history
Co-authored-by: Steffen Deusch <steffen.deusch@teaminternet.com>
  • Loading branch information
2 people authored and chrismccord committed Jan 17, 2024
1 parent 98027af commit 82a4df9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/js/phoenix_live_view/dom_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ export default class DOMPatch {
onBeforeElUpdated: (fromEl, toEl) => {
DOM.maybeAddPrivateHooks(toEl, phxViewportTop, phxViewportBottom)
DOM.cleanChildNodes(toEl, phxUpdate)
if(this.skipCIDSibling(toEl)){ return false }
if(this.skipCIDSibling(toEl)){
// if this is a live component used in a stream, we may need to reorder it
this.maybeReOrderStream(fromEl)
return false
}
if(DOM.isPhxSticky(fromEl)){ return false }
if(DOM.isIgnored(fromEl, phxUpdate) || (fromEl.form && fromEl.form.isSameNode(externalFormTriggered))){
this.trackBefore("updated", fromEl, toEl)
Expand Down

0 comments on commit 82a4df9

Please sign in to comment.