From 91b0b4415cca643df28c94d278f5e47bdd07f510 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 2 Dec 2022 13:29:47 -0600 Subject: [PATCH] updated button to deal with width for cells Signed-off-by: Matt Bruce --- VDS/Components/Buttons/Button/Button.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VDS/Components/Buttons/Button/Button.swift b/VDS/Components/Buttons/Button/Button.swift index 72953bdb..d23106af 100644 --- a/VDS/Components/Buttons/Button/Button.swift +++ b/VDS/Components/Buttons/Button/Button.swift @@ -143,6 +143,11 @@ open class Button: ButtonBase, Useable { //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- + open override var intrinsicContentSize: CGSize { + guard let width, width > 0 else { return super.intrinsicContentSize } + return CGSize(width: width > size.minimumWidth ? width : size.minimumWidth, height: size.height) + } + open override func updateView() { super.updateView() let bgColor = buttonBackgroundColorConfiguration.getColor(self)