pushed word change
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
9185e185fd
commit
60cefc57a6
@ -46,9 +46,9 @@ open class Checkboxes: VDS.CheckboxGroup, VDSMoleculeViewProtocol {
|
|||||||
open override func didSelect(_ selectedControl: CheckboxItem) {
|
open override func didSelect(_ selectedControl: CheckboxItem) {
|
||||||
super.didSelect(selectedControl)
|
super.didSelect(selectedControl)
|
||||||
|
|
||||||
// since the boxes has the state being tracked, we need to update the values here.
|
// since the checkboxes has the state being tracked, we need to update the values here.
|
||||||
if let index = items.firstIndex(where: {$0 === selectedControl}), let selectedBox = checkboxes?[index] {
|
if let index = items.firstIndex(where: {$0 === selectedControl}), let selected = checkboxes?[index] {
|
||||||
selectedBox.checkbox.selected = true
|
selected.checkbox.selected = true
|
||||||
}
|
}
|
||||||
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
|
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,10 +44,10 @@ open class RadioButtons: VDS.RadioButtonGroup, VDSMoleculeViewProtocol {
|
|||||||
open override func didSelect(_ selectedControl: RadioButtonItem) {
|
open override func didSelect(_ selectedControl: RadioButtonItem) {
|
||||||
super.didSelect(selectedControl)
|
super.didSelect(selectedControl)
|
||||||
|
|
||||||
// since the boxes has the state being tracked, we need to update the values here.
|
// since the radiobutton has the state being tracked, we need to update the values here.
|
||||||
if let index = items.firstIndex(where: {$0 === selectedControl}), let selectedBox = radioButtons?[index] {
|
if let index = items.firstIndex(where: {$0 === selectedControl}), let selected = radioButtons?[index] {
|
||||||
radioButtons?.forEach { $0.radioButton.state = false }
|
radioButtons?.forEach { $0.radioButton.state = false }
|
||||||
selectedBox.radioButton.state = true
|
selected.radioButton.state = true
|
||||||
}
|
}
|
||||||
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
|
_ = FormValidator.validate(delegate: delegateObject?.formHolderDelegate)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,8 @@ public class RadioButtonsModel: FormFieldModel {
|
|||||||
/// Returns the fieldValue of the selected RadioButton.
|
/// Returns the fieldValue of the selected RadioButton.
|
||||||
public override func formFieldValue() -> AnyHashable? {
|
public override func formFieldValue() -> AnyHashable? {
|
||||||
guard enabled else { return nil }
|
guard enabled else { return nil }
|
||||||
let selectedBox = radioButtons.first { $0.radioButton.state }
|
let selected = radioButtons.first { $0.radioButton.state }
|
||||||
return selectedBox?.radioButton.formFieldValue()
|
return selected?.radioButton.formFieldValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user