Fix validation on long form field
This commit is contained in:
parent
95ca500bd5
commit
acc8b77611
|
@ -8,8 +8,17 @@
|
||||||
|
|
||||||
let fieldState
|
let fieldState
|
||||||
let fieldApi
|
let fieldApi
|
||||||
let value
|
let previousValue = ""
|
||||||
$: fieldApi?.setValue(value)
|
let value = ""
|
||||||
|
|
||||||
|
$: {
|
||||||
|
// Only actually update the value when it changes, so that we don't trigger
|
||||||
|
// validation unnecessarily
|
||||||
|
if (value !== previousValue) {
|
||||||
|
fieldApi?.setValue(value)
|
||||||
|
previousValue = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Options for rich text component
|
// Options for rich text component
|
||||||
const options = {
|
const options = {
|
||||||
|
|
Loading…
Reference in New Issue