UITextField not updating text correctly when using auto layout with baseline constraint

Originator:chaselatta
Number:rdar://16412115 Date Originated:3-24-14
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 7.0, iOS 7.1
Classification:Bug Reproducible:Always
 
Summary:
When a UITextField is placed in a UITableViewCell and a baseline constraint is set on a label next to it the view does not correctly update when text reaches the end of the text field.  The text field does not scroll horizontally so the newly entered text is visible.

However, if the text field is constrained with both a top and bottom constraint to its containing view the text field updates properly.  

This seems to only be a problem when this view setup is placed in a UITableViewCell.  I tried the exact same setup in a plain UIView and everything worked as expected.

Steps to Reproduce:
- Create a UITableViewCell in a storyboard.
- Add subviews to the content view like so |-[label]-[textField]-|
- Constrain the label so it is vertically centered in the contentView.
- Constrain the textField so that it is aligned to the baseline of the label.
- Run the project and select the text field.
- Begin entering enough text so that the text has to scroll.
- See that the text does not scroll as expected.

- To make it work correctly:
- Remove the baseline constraint and constrain the textfield vertically like thus V:|-[textField]-|
- Run the program and enter text into the text field, this should work as expected.

Note: I only tested with a borderless text field.

Expected Results:
Both text fields should be have the exact same way.  The text should scroll horizontally to show the newly entered text.

Actual Results:
The text field that has a baseline constraint does not scroll its text horizontally as needed.

Version:
This only occurs on iOS 7 and iOS 7.1.  The problem doesn't occur in iOS 6.

Notes:


Configuration:
 I have been able to recreate this problem on the iPhone 5, iPad 4 and the simulator.  I did not test on any other hardware configurations.

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!