Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@matthew-carroll
Copy link
Contributor

@matthew-carroll matthew-carroll commented Jun 26, 2018

Support all keyboard actions for iOS and Android. (#11344)

There is a corresponding framework PR:
flutter/flutter#18855

- (BOOL)shouldChangeTextInRange:(UITextRange*)range replacementText:(NSString*)text {
if (self.returnKeyType == UIReturnKeyDone && [text isEqualToString:@"\n"]) {
[self resignFirstResponder];
[self removeFromSuperview];
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Copy link
Member

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!!

@xster
Copy link
Member

xster commented Jun 27, 2018

LGTM

@matthew-carroll matthew-carroll merged commit 061e899 into flutter:master Jul 2, 2018
bkonyi pushed a commit that referenced this pull request Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants