Skip to content

Obfuscated text fields should disable the IME autocorrect (iOS) #26684

@jbg

Description

@jbg

Internal: b/144379659

iOS beautifies punctuation automatically in text input fields, for example in my locale by turning "foo" into “foo” and 'bar' into ‘bar’. In another locale these might instead become «foo» and ‹bar›. Replacements also occur for sequences of dashes, for example -- becomes the em dash (—).

This feature is generally desirable (at least to me), but having control over it can be very useful in some situations. For example, I am developing an app that involves sending messages, which in some cases are sent over SMS (which has complex text encoding considerations) and in other cases directly via my servers (which simply use UTF-8). When I know the message will be sent over SMS, I would like to disable this feature on the text field, as even a single “smart quote” character will cause the entire message to be sent as UCS-2/UTF-16, costing the user twice as much per character.

Another example would be a TextField used for entering code, or for data entry, where the " character is not necessarily punctuation.

iOS provides the ability to control this functionality via methods on UITextInputTraits, specifically smartQuotesType and smartDashesType. I was unable to find an equivalent on Android, and my limited experience suggests that this type of automatic punctuation replacement isn’t a feature of Android.

Would a patch that adds support for controlling “smart punctuation” behaviour on TextField be accepted despite this functionality being (currently) specific to iOS?

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsengineflutter/engine related. See also e: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions