Resizing a UITextField in response to changing its text, doesn't scroll text into view anymore

Originator:avedesk
Number:rdar://34708504 Date Originated:28-Sep-2017 10:03 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11
Classification:UI/Usability Reproducible:Always
 
Summary:
We have  a UITextField that we size-to-fit directly after we have set the .text property, by triggering a layout pass directly (layoutIfNeeded) on the parent view.  On iOS10 and before, the full text would scroll into view always. Since iOS11, the textfield doesn't seem to update its internal scroll position anymore, so some text stays hidden, even if there's enough space for it.

Steps to Reproduce:
1. Have a UITextField and call .text = "blaaaaa" on it
2. Trigger a direct layout pass (layoutIfNeeded) on its parent view and size-to-fit the UITextField

Expected Results:
- full text would be visible in the UITextField

Actual Results:
- beginning of the text is cut-off in the UITextField (related to the previous smaller size of the UITextField), because it didn't update its scroll position in its inner scrollview.

Version:
iOS 11

Notes:
This is a regression from iOS10: this worked fine on iOS10.

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!