react-native-context-menu-view icon indicating copy to clipboard operation
react-native-context-menu-view copied to clipboard

Crash when opening context menu on Macbook Pro (designed for ipad)

Open atambo opened this issue 10 months ago • 2 comments

So the context menu works fine on iphones/ipads but when I install my app on my Macbook Pro laptop it crashes immediately when opening the context menu. Here is the crash:

(I'm running the app using xcode and can grab whatever logs are helpful for you, this is just what shows up in the xcode console)

CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them
*** Assertion failure in -[UINSHostMenu initWithTitle:], NSMenu.m:411
Invalid parameter not satisfying: aTitle != nil
(
	0   CoreFoundation                      0x000000019719e2cc __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x0000000196c82158 objc_exception_throw + 60
	2   Foundation                          0x000000019831220c -[NSCalendarDate initWithCoder:] + 0
	3   AppKit                              0x000000019a9817f8 -[NSMenu initWithTitle:] + 192
	4   UIKitMacHelper                      0x00000001b040accc -[UINSHostMenu initWithProxy:] + 88
	5   UIKitMacHelper                      0x00000001b040aae8 UINSNSMenuFromUINSMenu + 112
	6   UIKitMacHelper                      0x00000001b040a9f0 -[UINSMenuController _createNSMenu:forContextMenu:] + 84
	7   UIKitMacHelper                      0x00000001b04741f4 -[UINSMenuController _prepareToShowContextMenu:activityItemsConfiguration:] + 112
	8   UIKitMacHelper                      0x00000001b0473f48 -[UINSMenuController showDropdownMenu:fromControlRect:inWindow:attachmentEdge:alignmentEdge:activityItemsConfiguration:] + 288
	9   UIKitCore                           0x00000001c77acc44 __136-[_UIMenuBarController _showContextMenu:view:inWindow:atLocationInWindow:activityItemsConfiguration:style:willCloseBlock:didCloseBlock:]_block_invoke_7 + 44
	10  CoreFoundation                      0x0000000197129050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
	11  CoreFoundation                      0x0000000197128f64 __CFRunLoopDoBlocks + 356
	12  CoreFoundation                      0x0000000197127dbc __CFRunLoopRun + 848
	13  CoreFoundation                      0x0000000197127414 CFRunLoopRunSpecific + 608
	14  HIToolbox                           0x00000001a18d419c RunCurrentEventLoopInMode + 292
	15  HIToolbox                           0x00000001a18d3e2c ReceiveNextEventCommon + 220
	16  HIToolbox                           0x00000001a18d3d30 _BlockUntilNextEventMatchingListInModeWithFilter + 76
	17  AppKit                              0x000000019a988cc8 _DPSNextEvent + 660
	18  AppKit                              0x000000019b17f4d0 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 700
	19  AppKit                              0x000000019a97bffc -[NSApplication run] + 476
	20  AppKit                              0x000000019a953240 NSApplicationMain + 880
	21  AppKit                              0x000000019aba6654 +[NSWindow _savedFrameFromString:] + 0
	22  UIKitMacHelper                      0x00000001b0408f50 UINSApplicationMain + 972
	23  UIKitCore                           0x00000001c65e47bc UIApplicationMain + 148
	24  Sizzle                              0x0000000100e087c0 main + 96
	25  dyld                                0x0000000196cbf154 start + 2476
)

atambo avatar Mar 11 '25 14:03 atambo

It seems like the title prop on ContextMenu is required on MacOS. When I set the title prop to an empty string it stopped crashing.

atambo avatar Mar 12 '25 02:03 atambo

Oh wow that's a great find!

mpiannucci avatar Mar 12 '25 10:03 mpiannucci