From dfa49641d8f047900b366903b9d7a656c46f7525 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Thu, 16 Apr 2020 13:30:15 -0400 Subject: [PATCH] disable tap if radio is disabled --- MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift | 3 +++ .../ListLeftVariableRadioButtonAndPaymentMethod.swift | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index a5fedef0..1a968b7a 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -90,6 +90,9 @@ import UIKit /// The action performed when tapped. func tapAction() { + if !isEnabled { + return + } if let radioButtonModel = radioButtonSelectionHelper { radioButtonModel.selected(self) } else { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 4597a0b9..7bf1ff6a 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -71,9 +71,6 @@ import UIKit } public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { - - if radioButton.isEnabled { - radioButton.tapAction() - } + radioButton.tapAction() } }