material-components-ios
material-components-ios copied to clipboard
MDCTextInputControllerFilled LeadingUnderLineLabel Content Height
For usage questions: ask on Stack Overflow.
Actually I'm not sure this is bug or not.
Reproduction steps
Steps to reproduce the behavior:
@IBOutlet weak var fullNameContainerView: UIView!
// MDCTextFields
let txtFieldFullName:MDCTextField = {
let txtField = MDCTextField()
txtField.setUpMDCTextField()
return txtField
}()
func setUpMDCTextField() {
self.translatesAutoresizingMaskIntoConstraints = false
self.autocapitalizationType = .words
self.keyboardType = .alphabet
}
// MDCTextInputControllerFilled
lazy var txtFieldControllerFullName:MDCTextInputControllerFilled = {
let fullNameController = OMFloatingTextController(textInput: txtFieldFullName)
fullNameController.setup()
fullNameController.placeholderText = "add_address_full_name".localized
txtFieldFullName.setUpMDCTextFieldToController(delegate: self, leadingViewMode: .always, trailingViewMode: .never, leadingImage: UIImageView(image: #imageLiteral(resourceName: "icUserGrayStar24")), trailingView: nil)
return fullNameController
}()
func setUpMDCTextFieldToController(delegate: UITextFieldDelegate, leadingViewMode: UITextField.ViewMode?, trailingViewMode: UITextField.ViewMode?, leadingImage: UIImageView?, trailingView: UIImageView?) {
self.delegate = delegate
self.font = UIFont.heading16
self.leadingUnderlineLabel.numberOfLines = 0
self.leadingUnderlineLabel.lineBreakMode = .byTruncatingTail
self.placeholderLabel.font = UIFont.paragraphText14Pt
self.placeholderLabel.textColor = .brownGrey2
self.underline?.backgroundColor = .veryLightPink
self.leadingViewMode = leadingViewMode!
self.trailingViewMode = trailingViewMode!
self.leadingView = leadingImage
self.trailingView = trailingView
}
override func viewDidLoad() {
super.viewDidLoad()
fullNameContainerView.addSubview(txtFieldFullName)
_ = txtFieldControllerFullName
txtFieldFullName.constraintView(toParentView: fullNameContainerView)
}
func constraintView(toParentView parentView:UIView)
{
self.translatesAutoresizingMaskIntoConstraints = false
leadingAnchor.constraint(equalTo: parentView.leadingAnchor).isActive = true
topAnchor.constraint(equalTo: parentView.topAnchor).isActive = true
trailingAnchor.constraint(equalTo: parentView.trailingAnchor).isActive = true
// bottomAnchor.constraint(equalTo: parentView.bottomAnchor).isActive = true
let vari = self.heightAnchor.constraint(equalToConstant: 56)
vari.priority = .defaultHigh
vari.isActive = true
}
Expected behavior
LeadingUnderLineLabel has to fit in the MDCTextInputControllerFilledController, LeadingUnderLineLabel top constraint should fit to at the bottom of the underline and LeadingUnderLineLabel has to grow with content height.
Actual behavior
- Go to '...' Here I'm Using MDCTextInputControllerFilled
- Tap on '....' When I tap on a textField have to show LeadingUnderLineLabel with content height. But it's overlapping to top.

Platform (please complete the following information)
- Device: [e.g. iPhone11pro]
- OS: [e.g. iOS 13.3]
The title doesn't have a [Component] prefix.