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:
5u3it 2017-10-20 02:26:35 +05:30 committed by Chris Bracken
parent 76fe159961
commit afbc193bde
2 changed files with 6 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;
}