-
- Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
Missing declaration in interface for a non-undefined value event.data, for HTML input
Reproduction
<input on:input={getInputHandler(/^[01]*$/)}/>
const getInputHandler = (pattern: RegExp) => {return(event: Event & { data: string }) => { console.log(event.data); // typed text const inputElement = event.target as HTMLInputElement; // codes }};Logs
Type '(event: Event & { data: string;}) => void' is not assignable to type 'FormEventHandler<HTMLInputElement>'.ts(2322)System Info
System: OS: Windows 10 10.0.19045 CPU: (12) x64 Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz Memory: 5.63 GB / 15.87 GB Binaries: Node: 20.12.0 - C:\Program Files\nodejs\node.EXE npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD pnpm: 9.0.5 - ~\AppData\Roaming\npm\pnpm.CMD Browsers: Edge: Chromium (126.0.2592.56) Internet Explorer: 11.0.19041.3636 npmPackages: svelte: ^4.2.12 => 4.2.15Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels