Skip to content

Commit 0c879a2

Browse files
committed
apply attributes before inserting elements into the DOM
1 parent 4ca16f9 commit 0c879a2

File tree

1 file changed

+7
-2
lines changed
  • packages/yew/src/dom_bundle/btag

1 file changed

+7
-2
lines changed

packages/yew/src/dom_bundle/btag/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,15 @@ impl Reconcilable for VTag {
123123
key,
124124
..
125125
} = self;
126-
slot.insert(parent, &el);
127-
126+
127+
// Apply attributes BEFORE inserting the element into the DOM
128+
// This is crucial for SVG animation elements where the animation
129+
// starts immediately upon DOM insertion
128130
let attributes = attributes.apply(root, &el);
129131
let listeners = listeners.apply(root, &el);
132+
133+
// Now insert the element with attributes already set
134+
slot.insert(parent, &el);
130135

131136
let inner = match self.inner {
132137
VTagInner::Input(f) => {

0 commit comments

Comments
 (0)