-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
muted
reactive without bind
and select/autofocus attributes …
…working with function calls Co-authored-by: Joel Howse <[email protected]>
- Loading branch information
1 parent
575900d
commit e26d8ff
Showing
8 changed files
with
82 additions
and
10 deletions.
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: `muted` reactive without `bind` and select/autofocus attributes working with function calls |
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
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/autofocus-with-call/_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,7 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
async test({ assert, errors }) { | ||
assert.deepEqual(errors, []); | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/runtime-runes/samples/autofocus-with-call/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,6 @@ | ||
<svelte:options runes /> | ||
<script> | ||
function test(){} | ||
</script> | ||
|
||
<input autofocus={test()} /> |
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/runtime-runes/samples/muted-without-bind-works/_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,13 @@ | ||
import { flushSync } from 'svelte'; | ||
import { ok, test } from '../../test'; | ||
|
||
export default test({ | ||
async test({ assert, target, logs }) { | ||
const btn = target.querySelector('button'); | ||
ok(btn); | ||
flushSync(() => { | ||
btn.click(); | ||
}); | ||
assert.deepEqual(logs, [true]); | ||
} | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/runtime-runes/samples/muted-without-bind-works/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,13 @@ | ||
<script> | ||
let muted = $state(false); | ||
function volume_change(node){ | ||
node.addEventListener("volumechange", () => { | ||
console.log(node.muted); | ||
}); | ||
} | ||
</script> | ||
|
||
<audio use:volume_change {muted}></audio> | ||
<button onclick={() => (muted = !muted)}></button> | ||
|
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/select-value-with-call/_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,7 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
async test({ assert, errors }) { | ||
assert.deepEqual(errors, []); | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/runtime-runes/samples/select-value-with-call/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,6 @@ | ||
<svelte:options runes /> | ||
<script> | ||
function test(){} | ||
</script> | ||
|
||
<select value={test()}></select> |