Input type="reset" clears out wrapped inputs
If the native input element is wrapped in a solid component,
<input type="reset" />
does not reset it back to its initial value but clears it out. https://playground.solidjs.com/anonymous/0a32e8f4-fab8-4583-a9a0-32e73e0a837aSolid Playground
Quickly discover what the solid compiler will generate from your JSX template
4 Replies
Oh yeah, and the question is is this a bug and if not is there a workaround?
Seems to be a bug to me.
Rather, this is a case for how solid treats attributes vs properties combined with native DOM behavior.
the ones directly on the native elements are compiled to eventually be attributes whereas spread might handle it as property or attribute.
and reset input resets the values back to the attribute value or
defaultValue
prop
in this case, value got treated as prop so it didn't make the cut for reset
while you can force it to be an attribute via attr: value
or prop:defaultValue
, it might be worth to rethink this.Manually using
attr:value
helped, thanks!