aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/Form.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
index 3eb94f64..783653ce 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
@@ -311,7 +311,7 @@ class Form<K : Any>(
if (markFields) control.validatorError = trans(fieldsParams?.requiredMessage) ?: "Value is required"
true
} else {
- val validatorPassed = control.visible && (fieldsParams?.validator?.invoke(control) ?: true)
+ val validatorPassed = !control.visible || (fieldsParams?.validator?.invoke(control) ?: true)
if (markFields) {
control.validatorError = if (!validatorPassed) {
trans(fieldsParams?.validatorMessage?.invoke(control)) ?: "Invalid value"