Fix hydration with empty spread attributes (#4647)

* Fix hydration of empty spread attributes

* add a regression test

* fix doctest
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-10-03 19:41:23 -07:00
1 parent f48aec7eff
commit 03801e1312
8 files changed
+94 -2

No files matched your search

+4 -1
View File
@@ -301,9 +301,12 @@ impl WebsysDom {
let id = vnode
.mounted_dynamic_attribute(*id, dom)
.ok_or(VNodeNotInitialized)?;
// We always need to hydrate the node even if the attributes are empty so we have
// a mount for the node later. This could be spread attributes that are currently empty,
// but will be filled later
mounted_id = Some(id);
for attribute in attributes {
let value = &attribute.value;
mounted_id = Some(id);
if let AttributeValue::Listener(_) = value {
if attribute.name == "onmounted" {
to_mount.push(id);