diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 75195368a7..ea36de564d 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -1145,14 +1145,9 @@ static BOOL IsSelectionRectBoundaryCloserToPoint(CGPoint point, } - (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/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm index 17ef8b2f2c..724def096d 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPluginTest.mm @@ -1299,15 +1299,15 @@ FLUTTER_ASSERT_ARC [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"]); } }