forked from firka/flutter
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user