Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down