From 68a72f6b2e32f18d303901d607008baaa5ddf3dd Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 22 Aug 2024 13:20:10 -0500 Subject: [PATCH] added isEqual to ItemDropDown Signed-off-by: Matt Bruce --- .../ItemDropdownEntryFieldModel.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/ItemDropdownEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/ItemDropdownEntryFieldModel.swift index 04d880ae..878b6023 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/ItemDropdownEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/ItemDropdownEntryFieldModel.swift @@ -78,4 +78,21 @@ import VDS try container.encode(feedbackTextPlacement, forKey: .feedbackTextPlacement) try container.encodeModelIfPresent(action, forKey: .action) } + + open override func isEqual(to model: any ModelComparisonProtocol) -> Bool { + guard super.isEqual(to: model), let model = model as? Self else { return false } + return options == model.options + && selectedIndex == model.selectedIndex + && showInlineLabel == model.showInlineLabel + && feedbackTextPlacement == model.feedbackTextPlacement + && action.isEqual(to: model.action) + } + + open override func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool { + guard super.isVisuallyEquivalent(to: model), let model = model as? Self else { return false } + return options == model.options + && selectedIndex == model.selectedIndex + && showInlineLabel == model.showInlineLabel + && feedbackTextPlacement == model.feedbackTextPlacement + } }