fix: ensure undefined attributes are removed during hydration

Attributes that are `undefined` on the client should be removed during hydration,
even if their value hasn't changed compared to `prev_value`.
pull/16178/head
floriskn 3 months ago
parent 931f211b25
commit 8e280992f0

@ -345,7 +345,11 @@ export function set_attributes(element, prev, next, css_hash, skip_warning = fal
}
var prev_value = current[key];
if (value === prev_value) continue;
// Skip if value is unchanged, unless it's `undefined` and the element still has the attribute
if (value === prev_value && !(value === undefined && element.hasAttribute(key))) {
continue;
}
current[key] = value;

Loading…
Cancel
Save