mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove AutoFill from context menu when using contextMenuHidden (#43468)
Summary: This pull request resolves the issue https://github.com/facebook/react-native/issues/43452 Previously, when utilizing `contextMenuHidden`, the context menu wasn't entirely hidden as the "AutoFill" option remained visible. However, it's now possible to eliminate it using the menu builder. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - hide AutoFill from context menu when using `contextMenuHidden` Pull Request resolved: https://github.com/facebook/react-native/pull/43468 Test Plan: Manual tests in RNTester: https://github.com/facebook/react-native/assets/39670088/dc0f828c-f613-412d-b560-f3b795dd3ffb Reviewed By: javache Differential Revision: D54902269 Pulled By: tdn120 fbshipit-source-id: e0f3d3b5a0817db1c072caf2f01648432c7d868d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3571f9a5c8
commit
493dbb2190
@@ -267,6 +267,16 @@ static UIColor *defaultPlaceholderColor(void)
|
||||
return [super canPerformAction:action withSender:sender];
|
||||
}
|
||||
|
||||
- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder
|
||||
{
|
||||
if (_contextMenuHidden) {
|
||||
if (@available(iOS 17.0, *)) {
|
||||
[builder removeMenuForIdentifier:UIMenuAutoFill];
|
||||
}
|
||||
}
|
||||
[super buildMenuWithBuilder:builder];
|
||||
}
|
||||
|
||||
#pragma mark - Dictation
|
||||
|
||||
- (void)dictationRecordingDidEnd
|
||||
|
||||
@@ -142,6 +142,16 @@
|
||||
return [super canPerformAction:action withSender:sender];
|
||||
}
|
||||
|
||||
- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder
|
||||
{
|
||||
if (_contextMenuHidden) {
|
||||
if (@available(iOS 17.0, *)) {
|
||||
[builder removeMenuForIdentifier:UIMenuAutoFill];
|
||||
}
|
||||
}
|
||||
[super buildMenuWithBuilder:builder];
|
||||
}
|
||||
|
||||
#pragma mark - Dictation
|
||||
|
||||
- (void)dictationRecordingDidEnd
|
||||
|
||||
Reference in New Issue
Block a user