Skip to content

Commit a44c0d5

Browse files
committed
fix: pass DOM node instead of innerHTML string to Idiomorph.morph
Idiomorph's innerHTML morphStyle expects a node reference, not a raw HTML string. Passing tmp (the wrapper element) instead of tmp.innerHTML fixes SVG rendering issues where nodes were being incorrectly diffed.
1 parent 4a776bd commit a44c0d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/app/src/components/generative-ui/widget-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ window.addEventListener('message', function(e) {
388388
// Use idiomorph to diff/patch DOM (preserves existing nodes, no flicker)
389389
if (window.Idiomorph) {
390390
try {
391-
Idiomorph.morph(content, tmp.innerHTML, {
391+
Idiomorph.morph(content, tmp, {
392392
morphStyle: 'innerHTML',
393393
callbacks: {
394394
beforeNodeAdded: function(node) {

0 commit comments

Comments
 (0)