mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
apply attributes before inserting elements into the DOM (#3892)
This commit is contained in:
parent
8390db0c07
commit
5a1864643f
@ -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());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user