-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use svg methods for updating svg attributes too
- Loading branch information
1 parent
24151c4
commit 11c8e55
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte": patch | ||
--- | ||
|
||
fix: use svg methods for updating svg attributes too |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/svelte/tests/runtime-runes/samples/svg-element-attribute-serialize/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/svelte/tests/runtime-runes/samples/svg-element-attribute-serialize/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script> | ||
let count = $state(0); | ||
</script> | ||
|
||
<svg class={count}> | ||
</svg> | ||
|
||
<button onclick={()=>count++}></button> |