input: move validation to setValue to affect incoming values too

This commit is contained in:
bordun 2020-11-09 19:46:45 +01:00
parent 2877877919
commit 6d9653a493

View file

@ -114,11 +114,6 @@ class Input extends Canvas {
inputChange() {
if (this.validation && !this.input.value.match(this.validation)) {
this.input.value = this.value
return
}
this.setValue(this.input.value, {sync:true, send:true})
}
@ -144,6 +139,11 @@ class Input extends Canvas {
setValue(v, options={} ) {
if (this.validation && !String(v).match(this.validation)) {
this.input.value = this.value
return
}
try {
this.value = JSON.parse(v)
} catch (err) {