#2524·shoelace

<sl-button> value is cleared with form reset

Author: lbird-mmaCreated Oct 22, 2025Updated Oct 24, 2025
Labelsbug

Describe the bug

In a form I have some submit sl-buttons, with a name/value pair, like <sl-button type='submit' name='rtype' value='month'>List by month</sl-button>

Their values are hardcoded, which means they are already in in the HTML source and not set by javascript.

When using a form reset button, <sl-button type='reset'>Reset</sl-button>, the value of the button is cleared. This should not happen as a form reset means all values are reset to their initial state.

It also happens with type='button' buttons, see the demo.

Demo

https://codepen.io/lbird-mma/pen/PwZJrEa