diff --git a/VDS/Components/InputStepper/InputStepper.swift b/VDS/Components/InputStepper/InputStepper.swift index 11fde045..9302d0ec 100644 --- a/VDS/Components/InputStepper/InputStepper.swift +++ b/VDS/Components/InputStepper/InputStepper.swift @@ -361,18 +361,16 @@ open class InputStepper: EntryFieldBase { return } + // Set the inputStepper's controlWidth based on percentage received relative to its parentView's frame. + let containerWidth: CGFloat = widthConstraintConstant ?? containerView.frame.size.width var stepperWidthConstant: CGFloat? var stepperWidth: CGFloat - var containerWidth: CGFloat switch controlWidth { case .percentage(let percentage): - // Set the inputStepper's controlWidth based on percentage received relative to its parentView's frame. - containerWidth = widthConstraintConstant ?? CGFloat(containerView.frame.size.width) stepperWidth = max(containerWidth * ((percentage) / 100), minWidth) case .value(let value): - containerWidth = widthConstraintConstant ?? CGFloat(containerView.frame.size.width) stepperWidth = value }