mirror of https://github.com/sveltejs/svelte
fix: use svg methods for updating svg attributes too (#11755)
Closes #11746 we were using the svg methods for every child of svg but not for svg itselfpull/11753/head
parent
d15fd9556f
commit
7dacf2c4d4
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: use svg methods for updating svg attributes too
|
@ -0,0 +1,18 @@
|
||||
import { flushSync } from '../../../../src/index-client';
|
||||
import { test, ok } from '../../test';
|
||||
|
||||
export default test({
|
||||
mode: ['client'],
|
||||
test({ assert, target }) {
|
||||
const svg = target.querySelector('svg');
|
||||
const button = target.querySelector('button');
|
||||
ok(svg);
|
||||
ok(button);
|
||||
|
||||
assert.equal(svg.getAttribute('class'), '0');
|
||||
flushSync(() => {
|
||||
button.click();
|
||||
});
|
||||
assert.equal(svg.getAttribute('class'), '1');
|
||||
}
|
||||
});
|
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
let count = $state(0);
|
||||
</script>
|
||||
|
||||
<svg class={count}>
|
||||
</svg>
|
||||
|
||||
<button onclick={()=>count++}></button>
|
Loading…
Reference in new issue