diff --git a/packages/yew/src/dom_bundle/btag/mod.rs b/packages/yew/src/dom_bundle/btag/mod.rs index e2520f2ec71..5eeda1fc9e7 100644 --- a/packages/yew/src/dom_bundle/btag/mod.rs +++ b/packages/yew/src/dom_bundle/btag/mod.rs @@ -123,11 +123,16 @@ impl Reconcilable for VTag { key, .. } = self; - slot.insert(parent, &el); + // Apply attributes BEFORE inserting the element into the DOM + // This is crucial for SVG animation elements where the animation + // starts immediately upon DOM insertion let attributes = attributes.apply(root, &el); let listeners = listeners.apply(root, &el); + // Now insert the element with attributes already set + slot.insert(parent, &el); + let inner = match self.inner { VTagInner::Input(f) => { let f = f.apply(root, el.unchecked_ref());