From 3c375bea391096dbe6ad9940e63105f25173b2ab Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 13 Mar 2024 08:59:39 -0500 Subject: [PATCH] update method to set text Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonBase.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/VDS/Components/Buttons/ButtonBase.swift b/VDS/Components/Buttons/ButtonBase.swift index 121b349b..0623bb3b 100644 --- a/VDS/Components/Buttons/ButtonBase.swift +++ b/VDS/Components/Buttons/ButtonBase.swift @@ -61,7 +61,7 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable { open var surface: Surface = .light { didSet { setNeedsUpdate() } } /// Text that will be used in the titleLabel. - open var text: String? { didSet { setNeedsUpdate() } } + open var text: String? { didSet { textSetMode = .text; setNeedsUpdate() } } /// Array of LabelAttributeModel objects used in rendering the text. open var textAttributes: [any LabelAttributeModel]? { nil } @@ -163,8 +163,7 @@ open class ButtonBase: UIButton, ViewProtocol, UserInfoable, Clickable { override public func setTitle(_ title: String?, for state: UIControl.State) { // When text is set, we may need to re-style it as attributedText // with the correct paragraph style to achieve the desired line height. - textSetMode = .text - styleText(title, for: state) + text = title } /// :nodoc: