diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 75195368a7266..ea36de564d408 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -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; - } if (action == @selector(paste:)) { // Forbid pasting images, memojis, or other non-string content. - return [UIPasteboard generalPasteboard].string != nil; + return [UIPasteboard generalPasteboard].hasStrings; } return [super canPerformAction:action withSender:sender]; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm index 17ef8b2f2c7c4..724def096d19c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm @@ -1299,15 +1299,15 @@ - (void)testCanCopyPasteWithScribbleEnabled { [mockInputView insertText:@"aaaa"]; [mockInputView selectAll:nil]; - XCTAssertFalse([mockInputView canPerformAction:@selector(copy:) withSender:NULL]); + XCTAssertTrue([mockInputView canPerformAction:@selector(copy:) withSender:NULL]); XCTAssertTrue([mockInputView canPerformAction:@selector(copy:) withSender:@"sender"]); XCTAssertFalse([mockInputView canPerformAction:@selector(paste:) withSender:NULL]); XCTAssertFalse([mockInputView canPerformAction:@selector(paste:) withSender:@"sender"]); [mockInputView copy:NULL]; - XCTAssertFalse([mockInputView canPerformAction:@selector(copy:) withSender:NULL]); + XCTAssertTrue([mockInputView canPerformAction:@selector(copy:) withSender:NULL]); XCTAssertTrue([mockInputView canPerformAction:@selector(copy:) withSender:@"sender"]); - XCTAssertFalse([mockInputView canPerformAction:@selector(paste:) withSender:NULL]); + XCTAssertTrue([mockInputView canPerformAction:@selector(paste:) withSender:NULL]); XCTAssertTrue([mockInputView canPerformAction:@selector(paste:) withSender:@"sender"]); } }