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.
pull/11740/head
Simon H 1 year ago committed by GitHub
parent c3489eb5de
commit 4f9096a5a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -40,7 +40,7 @@ export const DelegatedEvents = [
'contextmenu', 'contextmenu',
'focusin', 'focusin',
'focusout', 'focusout',
// 'input', This conflicts with bind:input 'input',
'keydown', 'keydown',
'keyup', 'keyup',
'mousedown', 'mousedown',

@ -1,14 +1,16 @@
import { flushSync } from 'svelte';
import { test, ok } from '../../test'; import { test, ok } from '../../test';
export default test({ export default test({
mode: ['client'], mode: ['client'],
async test({ assert, logs, target }) { test({ assert, logs, target }) {
const input = target.querySelector('input'); const input = target.querySelector('input');
ok(input); ok(input);
input.value = 'foo'; input.value = 'foo';
await input.dispatchEvent(new Event('input')); input.dispatchEvent(new Event('input', { bubbles: true }));
flushSync();
assert.deepEqual(logs, ['hi']); assert.deepEqual(logs, ['hi']);
} }

Loading…
Cancel
Save