Tabs cause UITextView to wrap lines prematurely.

Originator:jelly
Number:rdar://39333435 Date Originated:April 11 2018, 11:04 AM
Status:Open Resolved:
Product:UIKit Product Version:11.3
Classification:Bug Reproducible:Always
 
Summary:
I am encountering a bug in UITextView's (default?) handling of tabs that causes lines containing them to wrap prematurely. This becomes a problem when trying to use them to line text up, and is confusing to the end user. Notice that this paragraph wraps at the edges of the view controller, because the UITextView is constrained to the edges.

A sentence can have normal spaces, and will wrap as expected, unless it contains a tab character, which causes it to wrap after a certain point.

If the tab appears early on in the sentence (before the point at which the wrapping occurs), the tab character will display as expected.

I have looked into trying to resolve this issue with the layout manager and delegates, but I'm not sure how to alter this behaviour without turning off wrapping altogether, which is obviously not a reasonable solution in all situations (especially for user content).

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!