fix(js): preserve inline styles when cloning

This commit is contained in:
SGavrl committed 2026-08-01 15:41:45 +00:00
1 parent c327354911
commit 5d7a02041a
2 files changed
+26

No files matched your search

+4
View File
@@ -654,6 +654,10 @@ function _shallowCloneNode(node) {
const v = node.getAttribute(name);
if (v !== null) el.setAttribute(name, v);
}
// CSS declarations currently live on the JS wrapper independently of the
// DOM attribute. Copy that state as well so styles assigned through
// `node.style` survive cloning even before attribute reflection runs.
if (node.style && node.style.cssText) el.style.cssText = node.style.cssText;
return el;
}