Text in UITextField Shifts When Emojis And English Text are mixed.

Originator:jasdeep.saini
Number:rdar://31288016 Date Originated:3-27-2017
Status:Open Resolved:
Product:iOS + SDK Product Version:10
Classification: Reproducible:Always
 
Area:
UIKit

Summary:
The text in a UITextField with border style of none will shift if the user types english text and then adds emojis.

Watch "Text Field Shift.mov" to see the shift.
A sample project is included in "TextFieldShift.zip".

Steps to Reproduce:
1. Add a UITextField to a view controller in a story board or in a nib. (This does not work if the text field is added in code).
2. Set the border style to none.
3. Run the app.
4. Type "AA😀"


Expected Results:
Text will not shift when the user types.

Actual Results:
Every time the emoji is typed, the text will shift down.  Deleting the emoji will cause the text to shift back up.

Version:
 iOS 10+ (Did not try on earlier OSes)

Notes:
This problem can be fixed by:

1. Set the border style to anything but none.
2. In the viewDidLoad method of the view controller, set the border style to .none.

The text will not shift.

Configuration:
All iPhones

Attachments:
'Text Field Shift.mov' and 'TextFieldShift.zip' were successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!