diff --git a/TextFieldsCatalog/TextFields/UnderlinedTextView/UnderlinedTextView.swift b/TextFieldsCatalog/TextFields/UnderlinedTextView/UnderlinedTextView.swift index 18b5852..8c22904 100644 --- a/TextFieldsCatalog/TextFields/UnderlinedTextView/UnderlinedTextView.swift +++ b/TextFieldsCatalog/TextFields/UnderlinedTextView/UnderlinedTextView.swift @@ -71,6 +71,11 @@ open class UnderlinedTextView: InnerDesignableView, ResetableField, RespondableF // MARK: - Public Properties + /// This property sets a fixed initial height for the text field. + /// Affects auto expandability: if not null, then the text field will not auto expand. + /// Property **maxTextContainerHeight** will be ignored, must be set with the same height + public var fixedTextContainerHeight: CGFloat? + public var field: InnerTextView { return textView } @@ -599,7 +604,8 @@ private extension UnderlinedTextView { func updateViewHeight() { let hintHeight = hintService.hintHeight(containerState: containerState) - let textHeight = min(textViewHeight(), maxTextContainerHeight ?? CGFloat.greatestFiniteMagnitude) + let textHeight = fixedTextContainerHeight ?? min(textViewHeight(), + maxTextContainerHeight ?? CGFloat.greatestFiniteMagnitude) let freeSpace = freeVerticalSpace(isEmptyHint: hintHeight == 0) let actualViewHeight = textHeight + hintHeight + freeSpace let viewHeight = max(flexibleHeightPolicy.minHeight, actualViewHeight)