-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed some broken tests related with the new way of dealing with…
… old and new event-handling syntaxes
- Loading branch information
1 parent
ecd6c21
commit 5b08b50
Showing
12 changed files
with
61 additions
and
27 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/runtime-runes/samples/event-attribute-delegation-2/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
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/event-attribute-delegation-4/Component.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,7 @@ | ||
<script> | ||
const { children, ...props } = $props(); | ||
</script> | ||
|
||
<div {...props} on:click> | ||
{@render children()} | ||
</div> |
5 changes: 3 additions & 2 deletions
5
packages/svelte/tests/runtime-runes/samples/event-attribute-delegation-4/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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<script> | ||
import Component from "./Component.svelte"; | ||
import Sub from "./sub.svelte"; | ||
</script> | ||
|
||
<svelte:window onclick="{() => console.log('window main')}" /> | ||
<svelte:document onclick="{() => console.log('document main')}" /> | ||
|
||
<div on:click={() => console.log('div main 1')} on:click={() => console.log('div main 2')}> | ||
<Component on:click={() => console.log('div main 1')} on:click={() => console.log('div main 2')}> | ||
<button onclick={() => console.log('button main')}>main</button> | ||
</div> | ||
</Component> | ||
|
||
<Sub /> |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/event-attribute-delegation-5/Button.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,7 @@ | ||
<script> | ||
const { children, ...props } = $props(); | ||
</script> | ||
|
||
<button {...props} on:click> | ||
{@render children()} | ||
</button> |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/event-attribute-delegation-5/Component.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,7 @@ | ||
<script> | ||
const { children, ...props } = $props(); | ||
</script> | ||
|
||
<div {...props} on:click> | ||
{@render children()} | ||
</div> |
15 changes: 10 additions & 5 deletions
15
packages/svelte/tests/runtime-runes/samples/event-attribute-delegation-5/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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
<div onclick={() => console.log('outer div onclick')}> | ||
<div on:click={() => console.log('inner div on:click')}> | ||
<button onclick={() => console.log('button onclick')} on:click={() => console.log('button on:click')}>main</button> | ||
</div> | ||
</div> | ||
<script> | ||
import Component from "./Component.svelte"; | ||
import Button from "./Button.svelte"; | ||
</script> | ||
|
||
<Component onclick={() => console.log('outer div onclick')}> | ||
<Component on:click={() => console.log('inner div on:click')}> | ||
<Button onclick={() => console.log('button onclick')} on:click={() => console.log('button on:click')}>main</Button> | ||
</Component> | ||
</Component> |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/runtime-runes/samples/event-attribute-spread-collision/Button.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,7 @@ | ||
<script> | ||
const { children, ...props } = $props(); | ||
</script> | ||
|
||
<button {...props} on:click> | ||
{@render children()} | ||
</button> |
17 changes: 9 additions & 8 deletions
17
packages/svelte/tests/runtime-runes/samples/event-attribute-spread-collision/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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
<script> | ||
import Button from './Button.svelte'; | ||
let text = $state('click me'); | ||
let text2 = $state(''); | ||
let spread = { onclick: () => text = 'click spread' }; | ||
</script> | ||
|
||
<button onclick={() => text = 'click onclick'} {...spread}> | ||
<Button onclick={() => text = 'click onclick'} {...spread}> | ||
{text} | ||
</button> | ||
</Button> | ||
|
||
<button {...spread} onclick={() => text = 'click onclick'}> | ||
<Button {...spread} onclick={() => text = 'click onclick'}> | ||
{text} | ||
</button> | ||
</Button> | ||
|
||
<button onclick={() => text = 'click onclick'} {...spread} on:click={() => text2 = '!'}> | ||
<Button onclick={() => text = 'click onclick'} {...spread} on:click={() => text2 = '!'}> | ||
{text}{text2} | ||
</button> | ||
</Button> | ||
|
||
<button on:click={() => text2 = '?'} {...spread} onclick={() => text = 'click onclick'}> | ||
<Button on:click={() => text2 = '?'} {...spread} onclick={() => text = 'click onclick'}> | ||
{text}{text2} | ||
</button> | ||
</Button> |
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
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 |
---|---|---|
|
@@ -92,7 +92,7 @@ | |
}, | ||
"end": { | ||
"line": 28, | ||
"column": 32 | ||
"column": 33 | ||
} | ||
} | ||
] |
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
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