Fix streaming page: SX NIL namespace broke CSS matching on DOM elements
domCreateElement treated SX NIL (a truthy JS object) as a real namespace,
calling createElementNS("nil", tag) instead of createElement(tag). All
elements created by resolveSuspense ended up in the "nil" XML namespace
where CSS class selectors don't match.
Also fix ~suspense fallback: empty &rest list is truthy in SX, so
fallback content never rendered.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2681,7 +2681,7 @@ PLATFORM_DOM_JS = """
|
||||
|
||||
function domCreateElement(tag, ns) {
|
||||
if (!_hasDom) return null;
|
||||
if (ns) return document.createElementNS(ns, tag);
|
||||
if (ns && ns !== NIL) return document.createElementNS(ns, tag);
|
||||
return document.createElement(tag);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
(div :id (str "sx-suspense-" id)
|
||||
:data-suspense id
|
||||
:style "display:contents"
|
||||
(if children children fallback)))
|
||||
(if (not (empty? children)) children fallback)))
|
||||
|
||||
(defcomp ~error-page (&key title message image asset-url)
|
||||
(~base-shell :title title :asset-url asset-url
|
||||
|
||||
Reference in New Issue
Block a user