S
SolidJS2mo ago
anthy

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-32e73e0a837a
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
4 Replies
anthy
anthyOP2mo ago
Oh yeah, and the question is is this a bug and if not is there a workaround?
Madaxen86
Madaxen862mo ago
Seems to be a bug to me.
mdynnl
mdynnl2mo ago
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.
anthy
anthyOP2mo ago
Manually using attr:value helped, thanks!
Want results from more Discord servers?
Add your server