material-design-lite icon indicating copy to clipboard operation
material-design-lite copied to clipboard

Form reset should reset text fields to initial state

Open halvardos opened this issue 9 years ago • 1 comments

Calling .reset() on a form element, or using a reset button should reset text fields to initial state.

Codepen

At the moment the text field remains dirty (and invalid even if not required) after a reset requiring the developer to add a call to MaterialTextfield.checkDirty(); but this does not remove invalid state, so we have to manually call MaterialTextfield.change(); to both remove dirty and invalid state.

I see there are some issues that have been opened earlier about this but they have been closed without solving this issue. IMO this is not working as one would expect and should be remedied.

halvardos avatar Jun 20 '16 14:06 halvardos

We'll work on this with the V2 make-over. 1.x is as-is unless a community member would like to contribute a patch to address this.

Thanks for the report.

Garbee avatar Jun 20 '16 17:06 Garbee