Fix validation on long form field
This commit is contained in:
parent
af4f902e10
commit
6c6542c0c5
1 changed files with 11 additions and 2 deletions
|
@ -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 a new issue