Skip to content

Commit 4f9096a

Browse files
authored
chore: delegate input event (#11732)
We didn't delegate the input event back when we were also delegating `on:x` events, because it messes up the event/bindings/actions order. Since we're only doing that for `onx` event attributes now that reason is obsolete and we can start delegating it.
1 parent c3489eb commit 4f9096a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/svelte/src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const DelegatedEvents = [
4040
'contextmenu',
4141
'focusin',
4242
'focusout',
43-
// 'input', This conflicts with bind:input
43+
'input',
4444
'keydown',
4545
'keyup',
4646
'mousedown',

packages/svelte/tests/runtime-runes/samples/event-spread-rerun/_config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
import { flushSync } from 'svelte';
12
import { test, ok } from '../../test';
23

34
export default test({
45
mode: ['client'],
56

6-
async test({ assert, logs, target }) {
7+
test({ assert, logs, target }) {
78
const input = target.querySelector('input');
89
ok(input);
910

1011
input.value = 'foo';
11-
await input.dispatchEvent(new Event('input'));
12+
input.dispatchEvent(new Event('input', { bubbles: true }));
13+
flushSync();
1214

1315
assert.deepEqual(logs, ['hi']);
1416
}

0 commit comments

Comments
 (0)