From 9b22fb4e2f49957c88e44149abc5f0010aa25a07 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 14 Sep 2022 11:54:10 -0500 Subject: [PATCH] refactored hasError Signed-off-by: Matt Bruce --- VDS/Components/Checkbox/CheckboxGroup.swift | 15 +++++++++------ VDS/Components/RadioButton/RadioButtonGroup.swift | 7 ++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index d5ede710..85dd1134 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -28,13 +28,16 @@ public class CheckboxGroupBase 0 + if anySelected && newHasError { + newHasError = false } - model.hasError = newValue - model.selectors = selectors + selectorViews.forEach { handler in + handler.hasError = newHasError + } + model.hasError = newHasError + } } diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 81960feb..109aae53 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -35,13 +35,10 @@ public class RadioButtonGroupBase