pushed word change

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-08-21 15:47:27 -05:00
parent 9185e185fd
commit 60cefc57a6
3 changed files with 8 additions and 8 deletions

View File

@ -46,9 +46,9 @@ open class Checkboxes: VDS.CheckboxGroup, VDSMoleculeViewProtocol {
open override func didSelect(_ selectedControl: CheckboxItem) {
super.didSelect(selectedControl)
// since the boxes has the state being tracked, we need to update the values here.
if let index = items.firstIndex(where: {$0 === selectedControl}), let selectedBox = checkboxes?[index] {
selectedBox.checkbox.selected = true
// since the checkboxes has the state being tracked, we need to update the values here.
if let index = items.firstIndex(where: {$0 === selectedControl}), let selected = checkboxes?[index] {
selected.checkbox.selected = true
}
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
}

View File

@ -44,10 +44,10 @@ open class RadioButtons: VDS.RadioButtonGroup, VDSMoleculeViewProtocol {
open override func didSelect(_ selectedControl: RadioButtonItem) {
super.didSelect(selectedControl)
// since the boxes has the state being tracked, we need to update the values here.
if let index = items.firstIndex(where: {$0 === selectedControl}), let selectedBox = radioButtons?[index] {
// since the radiobutton has the state being tracked, we need to update the values here.
if let index = items.firstIndex(where: {$0 === selectedControl}), let selected = radioButtons?[index] {
radioButtons?.forEach { $0.radioButton.state = false }
selectedBox.radioButton.state = true
selected.radioButton.state = true
}
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
}

View File

@ -26,8 +26,8 @@ public class RadioButtonsModel: FormFieldModel {
/// Returns the fieldValue of the selected RadioButton.
public override func formFieldValue() -> AnyHashable? {
guard enabled else { return nil }
let selectedBox = radioButtons.first { $0.radioButton.state }
return selectedBox?.radioButton.formFieldValue()
let selected = radioButtons.first { $0.radioButton.state }
return selected?.radioButton.formFieldValue()
}
//--------------------------------------------------