From 7728afb122ce0ff7c52879932f5c7ef46831b027 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 2 Nov 2020 10:19:31 -0500 Subject: [PATCH] accessibility fix --- .../List/Miscellaneous/ListStoreLocator.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift index 24c7770a..6a1f0dc5 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift @@ -18,16 +18,16 @@ public let rightLabel = Label(fontStyle: .RegularBodySmall) private lazy var rightLabelStackItem: StackItem = { return StackItem(andContain: rightLabel) - }() + }() public lazy var horizontalStack: Stack = { return Stack(with: StackModel(molecules: [StackItemModel(horizontalAlignment: .fill), StackItemModel(horizontalAlignment: .fill), StackItemModel(horizontalAlignment: .trailing)], axis: .horizontal, spacing: Padding.Two), stackItems: [StackItem(andContain: leftHeadline), StackItem(andContain: heart), rightLabelStackItem]) - }() + }() public lazy var stack: Stack = { return Stack.createStack(with: [horizontalStack, leftBody, leftSubBody], axis: .vertical, spacing: 0) - }() + }() public var sizeObject: MFSizeObject? = MFSizeObject(standardSize: 12, standardiPadPortraitSize: 18) //------------------------------------------------------- @@ -76,6 +76,15 @@ return heroCenter } + public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + if listItemModel?.action != nil { + super.didSelectCell(at: index, delegateObject: delegateObject, additionalData: additionalData) + } else { + heart.tapAction() + updateAccessibilityLabel() + } + } + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 120 }