feat(StatusInput): introduce reset
API
This can be used to reset text, error message and validity state of inputs
This commit is contained in:
parent
6e8a36be86
commit
4b9d11d1d4
@ -38,6 +38,13 @@ Item {
|
|||||||
|
|
||||||
property var errors: ({})
|
property var errors: ({})
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
statusBaseInput.valid = false
|
||||||
|
statusBaseInput.pristine = true
|
||||||
|
statusBaseInput.text = ""
|
||||||
|
errorMessage = ""
|
||||||
|
}
|
||||||
|
|
||||||
function validate() {
|
function validate() {
|
||||||
if (!statusBaseInput.dirty && validationMode === StatusInput.ValidationMode.OnlyWhenDirty) {
|
if (!statusBaseInput.dirty && validationMode === StatusInput.ValidationMode.OnlyWhenDirty) {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user