forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat order attributes + actions too (sveltejs#4156)
Co-authored-by: Conduitry <[email protected]>
- Loading branch information
1 parent
d600b35
commit 3a49110
Showing
8 changed files
with
149 additions
and
62 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
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
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
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
38 changes: 38 additions & 0 deletions
38
test/runtime/samples/apply-directives-in-order-2/_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,38 @@ | ||
const value = []; | ||
export default { | ||
props: { | ||
value, | ||
}, | ||
|
||
async test({ assert, component, target, window }) { | ||
const inputs = target.querySelectorAll('input'); | ||
|
||
const event = new window.Event('input'); | ||
|
||
for (const input of inputs) { | ||
input.value = 'h'; | ||
await input.dispatchEvent(event); | ||
} | ||
|
||
assert.deepEqual(value, [ | ||
'1', | ||
'2', | ||
'3', | ||
'4', | ||
'5', | ||
'6', | ||
'7', | ||
'8', | ||
'9', | ||
'10', | ||
'11', | ||
'12', | ||
'13', | ||
'14', | ||
'15', | ||
'16', | ||
'17', | ||
'18', | ||
]); | ||
}, | ||
}; |
34 changes: 34 additions & 0 deletions
34
test/runtime/samples/apply-directives-in-order-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script> | ||
export let value = []; | ||
function one(elem) { elem.addEventListener('input', () => { value.push('1'); }); } | ||
function four(elem) { elem.addEventListener('input', () => { value.push('4'); }); } | ||
function eight(elem) { elem.addEventListener('input', () => { value.push('8'); }); } | ||
function twelve(elem) { elem.addEventListener('input', () => { value.push('12'); }); } | ||
function fifteen(elem) { elem.addEventListener('input', () => { value.push('15'); }); } | ||
function seventeen(elem) { elem.addEventListener('input', () => { value.push('17'); }); } | ||
const foo = { | ||
set two(v) { value.push('2'); }, | ||
set six(v) { value.push('6'); }, | ||
set nine(v) { value.push('9'); }, | ||
set eleven(v) { value.push('11'); }, | ||
set thirteen(v) { value.push('13'); }, | ||
set sixteen(v) { value.push('16'); }, | ||
} | ||
function three() { value.push('3'); } | ||
function five() { value.push('5'); } | ||
function seven() { value.push('7'); } | ||
function ten() { value.push('10'); } | ||
function fourteen() { value.push('14'); } | ||
function eighteen() { value.push('18'); } | ||
</script> | ||
|
||
<input use:one bind:value={foo.two} on:input={three} /> | ||
<input use:four on:input={five} bind:value={foo.six} /> | ||
<input on:input={seven} use:eight bind:value={foo.nine} /> | ||
<input on:input={ten} bind:value={foo.eleven} use:twelve /> | ||
<input bind:value={foo.thirteen} on:input={fourteen} use:fifteen /> | ||
<input bind:value={foo.sixteen} use:seventeen on:input={eighteen} /> |