Skip to content

Commit

Permalink
fix: addedNode rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Dec 15, 2023
1 parent 4cbd079 commit 6f2946a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,15 @@ Observer.init({
callback: function (mutation) {
if (mutation.target.hasAttribute('render-clone'))
return
let parentElement = mutation.target.parentElement.closest(['render'])
let parentElement = mutation.target.parentElement.closest('[render]')
if (!parentElement) return

return
let renderedNode = renderedNodes.get(parentElement)
let data = renderedNode.source.data
let data
if (renderedNode.source)
data = renderedNode.source.data
if (renderedNode.template)
data = renderedNode.template.source.data

render({ element: mutation.target, data });

Expand Down

0 comments on commit 6f2946a

Please sign in to comment.