-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Duplicate key "checked" in object literal: <input type="checkbox" checked={field.value} /> #232
Comments
Interesting. I never had this problem. The second should overwrite the first. I have no idea and recommend creating an issue at Vite or SolidJS. |
Thanks @fabian-hiller. Is the suggestion solution feasible though? <Field type="boolean" name="checkboxFieldExample">
{(field, props) => (
<label>
<input
type="checkbox"
{...(props.checked !== undefined ? {} : { checked: field.value })}
{...props}
/>
<span>Field label goes here..</span>
</label>
)}
</Field> |
This is currently not possible because |
The following warning is thrown at build time by Vite. I couldn't find a way to conditionally set the "checked" value based on the "checked" prop/attr being there or not.
I see I can use Modular Form's "Checkbox" element - not sure if that has the same issue or not - but I want to use a vanilla field instead.
Error:
FYI Here's the whole html block where this is happening:
Ideally - I should be able to do something like this (doesn't work obviously):
Any recommendations?
The text was updated successfully, but these errors were encountered: