From 4a337c6fcba557603f912c0acaa941d96282494a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 10 May 2024 11:06:59 -0500 Subject: [PATCH] fixed minwidth bug Signed-off-by: Matt Bruce --- VDS/Components/DropdownSelect/DropdownSelect.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VDS/Components/DropdownSelect/DropdownSelect.swift b/VDS/Components/DropdownSelect/DropdownSelect.swift index 85c2c104..aab62e19 100644 --- a/VDS/Components/DropdownSelect/DropdownSelect.swift +++ b/VDS/Components/DropdownSelect/DropdownSelect.swift @@ -59,7 +59,7 @@ open class DropdownSelect: EntryFieldBase { //-------------------------------------------------- internal var minWidthDefault = 66.0 internal var minWidthInlineLabel = 102.0 - + internal var minWidth: CGFloat { showInlineLabel ? minWidthInlineLabel : minWidthDefault } //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- @@ -184,13 +184,13 @@ open class DropdownSelect: EntryFieldBase { selectedOptionLabel.isEnabled = isEnabled //set the width constraints - if let width { + if let width, width > minWidth { widthConstraint?.constant = width widthConstraint?.isActive = true minWidthConstraint?.isActive = false maxWidthConstraint?.isActive = false } else { - minWidthConstraint?.constant = showInlineLabel ? minWidthInlineLabel : minWidthDefault + minWidthConstraint?.constant = minWidth maxWidthConstraint?.constant = frame.width widthConstraint?.isActive = false minWidthConstraint?.isActive = true