mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Native keyboard behavior update for multiline input (flutter/engine#4234)
Use sentence capitalization for non-obscuretext fields of TextInputType.text and TextInputType.multiline on iOS and Android.
This commit is contained in:
parent
76fe159961
commit
afbc193bde
@ -98,8 +98,11 @@ public class TextInputPlugin implements MethodCallHandler {
|
||||
// Note: both required. Some devices ignore TYPE_TEXT_FLAG_NO_SUGGESTIONS.
|
||||
textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
|
||||
textType |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
|
||||
} else if (autocorrect) {
|
||||
} else {
|
||||
if (autocorrect)
|
||||
textType |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
|
||||
if (inputType.equals("TextInputType.text") || inputType.equals("TextInputType.multiline"))
|
||||
textType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
||||
}
|
||||
return textType;
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@ static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) {
|
||||
static UITextAutocapitalizationType ToUITextAutocapitalizationType(NSString* inputType) {
|
||||
if ([inputType isEqualToString:@"TextInputType.text"])
|
||||
return UITextAutocapitalizationTypeSentences;
|
||||
if ([inputType isEqualToString:@"TextInputType.multiline"])
|
||||
return UITextAutocapitalizationTypeSentences;
|
||||
return UITextAutocapitalizationTypeNone;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user