File tree Expand file tree Collapse file tree 2 files changed +22
-24
lines changed
React/Fabric/Mounting/ComponentViews/Text Expand file tree Collapse file tree 2 files changed +22
-24
lines changed Original file line number Diff line number Diff line change @@ -241,27 +241,26 @@ - (void)disableContextMenu
241
241
- (void )handleLongPress : (UILongPressGestureRecognizer *)gesture
242
242
{
243
243
#if !TARGET_OS_UIKITFORMAC
244
- if (@available (iOS 16.0 , *)) {
244
+ if (@available (iOS 16.0 , macCatalyst 16.0 , *)) {
245
245
CGPoint location = [gesture locationInView: self ];
246
246
UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier: nil sourcePoint: location];
247
247
if (_editMenuInteraction) {
248
248
[_editMenuInteraction presentEditMenuWithConfiguration: config];
249
249
}
250
- return ;
251
- }
252
- // TODO: Adopt showMenuFromRect (necessary for UIKitForMac)
253
- UIMenuController *menuController = [UIMenuController sharedMenuController ];
254
-
255
- if (menuController.isMenuVisible ) {
256
- return ;
257
- }
250
+ } else {
251
+ UIMenuController *menuController = [UIMenuController sharedMenuController ];
258
252
259
- if (!self. isFirstResponder ) {
260
- [ self becomeFirstResponder ] ;
261
- }
253
+ if (menuController. isMenuVisible ) {
254
+ return ;
255
+ }
262
256
257
+ if (!self.isFirstResponder ) {
258
+ [self becomeFirstResponder ];
259
+ }
260
+
263
261
[menuController setTargetRect: self .bounds inView: self ];
264
262
[menuController setMenuVisible: YES animated: YES ];
263
+ }
265
264
#endif
266
265
}
267
266
Original file line number Diff line number Diff line change @@ -237,27 +237,26 @@ - (void)disableContextMenu
237
237
- (void )handleLongPress : (UILongPressGestureRecognizer *)gesture
238
238
{
239
239
#if !TARGET_OS_UIKITFORMAC
240
- if (@available (iOS 16.0 , *)) {
240
+ if (@available (iOS 16.0 , macCatalyst 16.0 , *)) {
241
241
CGPoint location = [gesture locationInView: self ];
242
242
UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier: nil sourcePoint: location];
243
243
if (_editMenuInteraction) {
244
244
[_editMenuInteraction presentEditMenuWithConfiguration: config];
245
245
}
246
- return ;
247
- }
248
- // TODO: Adopt showMenuFromRect (necessary for UIKitForMac)
249
- UIMenuController *menuController = [UIMenuController sharedMenuController ];
250
-
251
- if (menuController.isMenuVisible ) {
252
- return ;
253
- }
246
+ } else {
247
+ UIMenuController *menuController = [UIMenuController sharedMenuController ];
254
248
255
- if (!self. isFirstResponder ) {
256
- [ self becomeFirstResponder ] ;
257
- }
249
+ if (menuController. isMenuVisible ) {
250
+ return ;
251
+ }
258
252
253
+ if (!self.isFirstResponder ) {
254
+ [self becomeFirstResponder ];
255
+ }
256
+
259
257
[menuController setTargetRect: self .bounds inView: self ];
260
258
[menuController setMenuVisible: YES animated: YES ];
259
+ }
261
260
#endif
262
261
}
263
262
You can’t perform that action at this time.
0 commit comments