Commit 3ae38a31 by Orkhan Alikhanov

Fixed TextField was ignoring textInsets in minimum height calculation

parent d69d693a
......@@ -64,9 +64,14 @@ public protocol TextFieldDelegate: UITextFieldDelegate {
}
open class TextField: UITextField {
/// Minimum TextField height
private var minimumTextHeight: CGFloat = 32
/// Default size when using AutoLayout.
open override var intrinsicContentSize: CGSize {
return CGSize(width: bounds.width, height: max(32, super.intrinsicContentSize.height))
let h = textInsets.top + textInsets.bottom + minimumTextHeight
return CGSize(width: bounds.width, height: max(h, super.intrinsicContentSize.height))
}
/// A Boolean that indicates if the placeholder label is animated.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment