I have open the issue at MaterialComponents on Github already but seem like no answer yet. The problem is when I click the textfield to be active then I click outside, it was working fine but when I repeat doing that, the placeholder for the textfield will be always on the top
Here is the problem as an image
When we repeat click on textfield then click outside again it will look like this
Here is the code:
@IBOutlet weak var textfieldFloating: MDCTextField!
let tf = MDCTextInputControllerOutlined()
override func viewDidLoad() {
super.viewDidLoad()
textfieldFloating.leftView = UIImageView(image: UIImage(named: "ic_lock_outline_white_18pt"))
textfieldFloating.leftViewMode = .always
textfieldFloating.placeholder = "Placeholder"
tf.textInput = textfieldFloating
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.view.endEditing(true)
}