I want to use the browsers native support for resetting all fields' values of a form to their default or initial state using an <input type"reset"> element.
In HTML
In native HTML, clicking the reset input will remove any user input and reset the field to whatever is set in as the value inline parameter: value='default value', and if it's empty or missing, it will reset to an empty field.
input{
display:block;
margin:10px;
}
<form>
<input type="text" value="default value">
<input type="text" value="">
<input type="text">
<input type="reset">
</form>
In Svelte
In Svelte, the value attribute seems to never be printed in the html. As a results, clicking the reset input will empty every fields instead of reseting them to their initial values. Here's an example in Svelte REPL
So is there a way to force the native behaviour without handling it with javascript? is there a way to force svelte to print an inline attribute and never update it?