Fix renderDOM swallowing pre-rendered DOM nodes as empty dicts
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m20s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m20s
renderComponentDOM now eagerly renders kwarg values that are render expressions (HTML tags, <>, ~components) into DOM nodes. But renderDOM treated any non-array object as a dict and returned an empty fragment, silently discarding pre-rendered content. Add a nodeType check to pass DOM nodes through unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -691,6 +691,9 @@
|
||||
// Keyword → text
|
||||
if (isKw(expr)) return document.createTextNode(expr.name);
|
||||
|
||||
// Pre-rendered DOM node → return as-is
|
||||
if (expr && expr.nodeType) return expr;
|
||||
|
||||
// Dict → empty
|
||||
if (expr && typeof expr === "object" && !Array.isArray(expr)) return document.createDocumentFragment();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user