-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add files and group properties to HTMLInputAttributes #15492
fix: Add files and group properties to HTMLInputAttributes #15492
Conversation
Adds missing `files` and `group` to match the respective `bind:files` and `bind:group`.
🦋 Changeset detectedLatest commit: fec6912 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Ah, interesting — hadn't noticed the prop typing issue. The fix you propose definitely makes sense for For <!-- is checked when `choice === 'one'` -->
<input type="radio" group={choice} value="one" /> ...but you can't, it just (uselessly/confusingly) sets a |
I vote for "lie a bit" - I cannot imagine someone tripping up on that in practise. |
What about making it condition on the input type ? interface HTMLInputAttributes<Type extends HTMLInputTypeAttribute | undefined | null = undefined> extends HTMLAttributes<HTMLInputElement> {
...
group?: Type extends 'checkbox' | 'radio' ? any | undefined | null : never;
...
} However, doesn't this issues also exist for other specific bindings, like |
This wouldn't solve the issue @Rich-Harris is talking about tho |
Not completely, but it would restrict it to the checkbox and radio inputs, lessen the lie in some way ? |
|
This adds missing
files
andgroup
properties to match the respectivebind:files
andbind:group
.Unless I'm mistaken, it seems that the
files
andgroup
attributes are missing from the HTMLInputAttributes type in element.d.ts.The typings for the binding 'bind:group' and 'bind:files' are present (as seen here) but the individual properties aren't.
Note that the bindings exists on the deprecated
SvelteInputProps
, so maybe this is intentional somehow ?Closes issue #14579