Fix validation on long form field

This commit is contained in:
Andrew Kingston 2021-01-29 10:28:13 +00:00
parent 95ca500bd5
commit acc8b77611
1 changed files with 11 additions and 2 deletions

View File

@ -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 = {