-
Notifications
You must be signed in to change notification settings - Fork 6k
iPad keyboard cut/copy/paste buttons #50923
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1145,14 +1145,9 @@ - (BOOL)resignFirstResponder { | |
| } | ||
|
|
||
| - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { | ||
| // When scribble is available, the FlutterTextInputView will display the native toolbar unless | ||
| // these text editing actions are disabled. | ||
| if ([self isScribbleAvailable] && sender == NULL) { | ||
| return NO; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fbcouch Any idea if this is still doing anything important?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be worth checking on iPadOS 16 vs 17 just to be sure (I have an iPad that's only on 16, so I can test that one once this is built, if needed), but it may be that other things in the engine or OS have changed to prevent the native toolbar from showing up
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I think I have an iPad with 17, I'll try it out tonight and post back.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think i looked into this but forgot - in what other cases will i vaguely remember when you enter memoji
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure, but yeah it looks like during Scribble. Flutter doesn't support selecting a memoji out of the box does it? I forgot to link my response here (#50923 (comment)), but I did try this out on a physical iOS 17 iPad and it seemed to work fine. I tried all of the Scribble features I could think of, plus normal soft keyboard text editing, including the text selection toolbar.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think i remember it wrongly. memoji has nothing to do with this line.
Yes, but memoji is part of the keyboard that we don't control. So what we did was to make it a no-op when user choose their memoji. This is done with the |
||
| } | ||
| if (action == @selector(paste:)) { | ||
| // Forbid pasting images, memojis, or other non-string content. | ||
| return [UIPasteboard generalPasteboard].string != nil; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accessing the pasteboard string here was causing an unnecessary paste notification to show to the user when the keyboard was brought up. Using hasStrings instead fixes it. FYI @hellohuanlin. |
||
| return [UIPasteboard generalPasteboard].hasStrings; | ||
| } | ||
|
|
||
| return [super canPerformAction:action withSender:sender]; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
what is the "native toolbar"? i assume it's not the edit menu?
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.
From my memory I think the system context menu (AKA text selection toolbar) was showing up? Maybe @fbcouch can confirm.
I did not see that happen just now when I tested Scribble on an iPad running iOS 17.