-
Notifications
You must be signed in to change notification settings - Fork 6k
Support all keyboard actions. (#11344) #5620
Support all keyboard actions. (#11344) #5620
Conversation
| - (BOOL)shouldChangeTextInRange:(UITextRange*)range replacementText:(NSString*)text { | ||
| if (self.returnKeyType == UIReturnKeyDone && [text isEqualToString:@"\n"]) { | ||
| [self resignFirstResponder]; | ||
| [self removeFromSuperview]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these not still needed in the done case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure. My experimentation with an actual app didn't show any problem without them, and my assumption is that when the Flutter side says "unfocus" that those same methods are being invoked in some other execution path. But I'm not positive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI - @cbracken and I looked at Japanese and "done" style actions, as well as "next" style actions appear to work as desired with these lines removed.
|
|
||
| static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) { | ||
| if ([inputType isEqualToString:@"TextInputType.multiline"]) | ||
| // Where did the term "unspecified" come from? iOS has a "default" and Android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the extra context doc!!
|
LGTM |
Support all keyboard actions for iOS and Android. (#11344)
There is a corresponding framework PR:
flutter/flutter#18855