From ac1957d1c3ef71f2dc5488cee23e687abcade1f1 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 9 Aug 2024 14:38:32 -0500 Subject: [PATCH] using submit now Signed-off-by: Matt Bruce --- VDS/Components/RadioBox/RadioBoxItem.swift | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/VDS/Components/RadioBox/RadioBoxItem.swift b/VDS/Components/RadioBox/RadioBoxItem.swift index 1da80c0a..4ea010e6 100644 --- a/VDS/Components/RadioBox/RadioBoxItem.swift +++ b/VDS/Components/RadioBox/RadioBoxItem.swift @@ -165,11 +165,13 @@ open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- - /// Executed on initialization for this View. - open override func initialSetup() { - super.initialSetup() - onClick = { control in - control.toggle() + /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. + open override func setup() { + super.setup() + + onClick = { [weak self] _ in + guard let self, isEnabled else { return } + toggle() } selectorView.bridge_accessibilityLabelBlock = { [weak self] in @@ -205,12 +207,6 @@ open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable { return accessibilityLabels.joined(separator: ", ") } - } - - /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. - open override func setup() { - super.setup() - isAccessibilityElement = false selectorView.isAccessibilityElement = true selectorView.accessibilityTraits = .button