updated maxWidth
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
26a3206639
commit
ebbbffc86e
@ -61,8 +61,9 @@ open class DropdownSelect: EntryFieldBase<String> {
|
||||
internal var minWidthInlineLabel = 102.0
|
||||
internal override var minWidth: CGFloat { showInlineLabel ? minWidthInlineLabel : minWidthDefault }
|
||||
internal override var maxWidth: CGFloat {
|
||||
let frameWidth = frame.size.width
|
||||
return helperTextPlacement == .right ? (frameWidth - horizontalStackView.spacing) / 2 : frameWidth
|
||||
let frameWidth = constrainedWidth
|
||||
let halfWidth = (frameWidth - horizontalStackView.spacing) / 2
|
||||
return helperTextPlacement == .right && halfWidth > minWidth * 2 ? halfWidth : frameWidth
|
||||
}
|
||||
|
||||
/// The is used for the for adding the helperLabel to the right of the containerView.
|
||||
|
||||
@ -47,8 +47,9 @@ open class InputField: EntryFieldBase<String> {
|
||||
|
||||
internal override var minWidth: CGFloat { fieldType.handler().minWidth }
|
||||
internal override var maxWidth: CGFloat {
|
||||
let frameWidth = frame.size.width
|
||||
return helperTextPlacement == .right ? (frameWidth - horizontalStackView.spacing) / 2 : frameWidth
|
||||
let frameWidth = constrainedWidth
|
||||
let halfWidth = (frameWidth - horizontalStackView.spacing) / 2
|
||||
return helperTextPlacement == .right && halfWidth > minWidth * 2 ? halfWidth : frameWidth
|
||||
}
|
||||
|
||||
/// The is used for the for adding the helperLabel to the right of the containerView.
|
||||
@ -320,15 +321,12 @@ open class InputField: EntryFieldBase<String> {
|
||||
|
||||
internal override func updateContainerWidth() {
|
||||
widthConstraint?.deactivate()
|
||||
trailingLessThanEqualsConstraint?.deactivate()
|
||||
trailingEqualsConstraint?.deactivate()
|
||||
|
||||
//see if there is a widthPercentage and follow the same pattern as done for "width"
|
||||
let currentWidth = (horizontalPinnedWidth() ?? 0) * (widthPercentage ?? 0)
|
||||
if currentWidth >= minWidth, currentWidth <= maxWidth {
|
||||
widthConstraint?.constant = currentWidth
|
||||
widthConstraint?.activate()
|
||||
trailingLessThanEqualsConstraint?.activate()
|
||||
} else {
|
||||
super.updateContainerWidth()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user