material-components-ios
material-components-ios copied to clipboard
MDCTextInputControllerFilled - Placeholder text is missing and cursor is placed beyond textfield's width
I am using MDCTextInputControllerFilled.
The placeholder text is missing for the textfield's :
textField.placeholderText = "Text"
Also the cursor falls way outside the bounds of the textfield:

- OS: iOS 13
- Xcode 11
This works perfectly well on Xcode 10.2. This issue shows up only when using Xcode 11
The title doesn't have a [Component] prefix.
Hello @sonalikal, the attached image looks like an underlined text field. Have you tried using the newer and better-supported MDCUnderlinedTextField to accomplish this? The bug you are describing does not exist in MDCUnderlinedTextField.
Hello @sonalikal, the attached image looks like an underlined text field. Have you tried using the newer and better-supported
MDCUnderlinedTextFieldto accomplish this? The bug you are describing does not exist inMDCUnderlinedTextField.
Hi @andrewoverton. I tried looking up in the documentation about the TextField you mentioned, does it lie under the 'MaterialComponents/TextFields' pod because I'm unable to locate it. Maybe I'm looking in the wrong direction. Would appreciate your help.
Hi @sonalikal, sorry, it's a bit confusing. To use MDCUnderlinedTextField add TextControls+UnderlinedTextFields and/or TextControls+UnderlinedTextFieldsTheming to your Podfile. The TextFields component has our legacy text field implementation.
Hi @sonalikal, sorry, it's a bit confusing. To use
MDCUnderlinedTextFieldaddTextControls+UnderlinedTextFieldsand/orTextControls+UnderlinedTextFieldsThemingto your Podfile. The TextFields component has our legacy text field implementation.
Thanks for the clarification @andrewoverton. Is the floating placeholder property still applicable for this textfield. Sorry for the basic questions but I'm finding it a bit hard to transition from MDCTextInputControllerFilled to MDCUnderlinedTextField. Appreciate the help :)
Hello @sonalikal,
The new text fields differentiate between the floating label and the placeholder. Where you would've previously done something like this, if I remember correctly:
textInputController.textInput.placeholder = @"floating label text";
Now do this:
underlinedTextField.label.text = @"floating label text";
You can still set the placeholder on the new ones, but it'll be more like setting placeholder on a UITextField.
Let me know if you have any other questions!