File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed
React/Fabric/Mounting/ComponentViews/Text Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -246,19 +246,15 @@ - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture
246246 if (_editMenuInteraction) {
247247 [_editMenuInteraction presentEditMenuWithConfiguration: config];
248248 }
249- return ;
250- }
251- UIMenuController *menuController = [UIMenuController sharedMenuController ];
249+ } else {
250+ UIMenuController *menuController = [UIMenuController sharedMenuController ];
252251
253- if (menuController.isMenuVisible ) {
254- return ;
255- }
252+ if (menuController.isMenuVisible ) {
253+ return ;
254+ }
256255
257- if (!self.isFirstResponder ) {
258- [self becomeFirstResponder ];
256+ [menuController showMenuFromView: self rect: self .bounds];
259257 }
260-
261- [menuController showMenuFromView: self rect: self .bounds];
262258}
263259
264260- (BOOL )canBecomeFirstResponder
Original file line number Diff line number Diff line change @@ -236,25 +236,21 @@ - (void)disableContextMenu
236236
237237- (void )handleLongPress : (UILongPressGestureRecognizer *)gesture
238238{
239- if (@available (iOS 16.0 , *)) {
239+ if (@available (iOS 16.0 , macCatalyst 16.0 , *)) {
240240 CGPoint location = [gesture locationInView: self ];
241241 UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier: nil sourcePoint: location];
242242 if (_editMenuInteraction) {
243243 [_editMenuInteraction presentEditMenuWithConfiguration: config];
244244 }
245- return ;
246- }
247- UIMenuController *menuController = [UIMenuController sharedMenuController ];
245+ } else {
246+ UIMenuController *menuController = [UIMenuController sharedMenuController ];
248247
249- if (menuController.isMenuVisible ) {
250- return ;
251- }
248+ if (menuController.isMenuVisible ) {
249+ return ;
250+ }
252251
253- if (!self.isFirstResponder ) {
254- [self becomeFirstResponder ];
252+ [menuController showMenuFromView: self rect: self .bounds];
255253 }
256-
257- [menuController showMenuFromView: self rect: self .bounds];
258254}
259255
260256- (BOOL )canBecomeFirstResponder
You can’t perform that action at this time.
0 commit comments