From 528ae8a6854e1f137d804f6017a1e4f39bc32ecb Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 22 May 2020 16:25:12 -0400 Subject: [PATCH] Fix for specific molecule --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 12 +++++------- ...ListLeftVariableNumberedListAllTextAndLinks.swift | 5 +++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 35d45ac6..087e893c 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -674,15 +674,9 @@ public typealias ActionBlock = () -> () setScale(scale) } - open override func layoutSubviews() { - super.layoutSubviews() - - // This fixes a defect for when there are multiple labels stacked in a list item. Sometime some labels will not fill their available space. - preferredMaxLayoutWidth = frame.width - } - @objc public func updateView(_ size: CGFloat) { scaleSize = size as NSNumber + if let originalAttributedString = originalAttributedString { let attributedString = NSMutableAttributedString(attributedString: originalAttributedString) attributedString.removeAttribute(.font, range: NSRange(location: 0, length: attributedString.length)) @@ -881,6 +875,10 @@ extension Label { return true } + public func horizontalAlignment() -> UIStackView.Alignment { + return .leading + } + public func copyBackgroundColor() -> Bool { return true } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 9f2d62c9..f00e7ff1 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -58,4 +58,9 @@ import Foundation super.reset() leftLabel.styleTitle2XLarge(true) } + + open override func layoutSubviews() { + super.layoutSubviews() + eyebrowHeadlineBodyLink.body.preferredMaxLayoutWidth = eyebrowHeadlineBodyLink.frame.width + } }