diff --git a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm index 3fb6c8d6226..4ccff230dd0 100644 --- a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +++ b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm @@ -267,6 +267,16 @@ static UIColor *defaultPlaceholderColor(void) return [super canPerformAction:action withSender:sender]; } +- (void)buildMenuWithBuilder:(id)builder +{ + if (_contextMenuHidden) { + if (@available(iOS 17.0, *)) { + [builder removeMenuForIdentifier:UIMenuAutoFill]; + } + } + [super buildMenuWithBuilder:builder]; +} + #pragma mark - Dictation - (void)dictationRecordingDidEnd diff --git a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTUITextField.mm b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTUITextField.mm index 82b186ead5f..7ec5835df5c 100644 --- a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +++ b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTUITextField.mm @@ -142,6 +142,16 @@ return [super canPerformAction:action withSender:sender]; } +- (void)buildMenuWithBuilder:(id)builder +{ + if (_contextMenuHidden) { + if (@available(iOS 17.0, *)) { + [builder removeMenuForIdentifier:UIMenuAutoFill]; + } + } + [super buildMenuWithBuilder:builder]; +} + #pragma mark - Dictation - (void)dictationRecordingDidEnd