Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS crash with NSInternalInconsistencyException, UITargetedPreview #103

Open
rrebase opened this issue May 14, 2024 · 1 comment
Open

iOS crash with NSInternalInconsistencyException, UITargetedPreview #103

rrebase opened this issue May 14, 2024 · 1 comment

Comments

@rrebase
Copy link

rrebase commented May 14, 2024

Description

First of all, amazing work on this library 馃檶

I've ran into an issue with unmounting the component that causes a crash on iOS. This can be reproduced by having the context menu open while navigating to a different screen. It should close unmount and close gracefully, but instead it crashes.

At first glance, it seems different from the other reported issues.

Crash

ERROR  Your app just crashed. See the error below.
NSInternalInconsistencyException: This UITargetedPreview initializer requires that the view is in a window, but it is not. Either fix that, or use the other initializer that takes a target. (view: <ReactNativeIosContextMenu.RNIContextMenuView: 0x10d85de00> => <RCTView: 0x10b913ff0> => <RCTView: 0x31f75c510> => <RCTView: 0x31f75b910> => <RCTScrollContentView: 0x31f750f90> => <RCTCustomScrollView: 0x10e286a00> => <RCTScrollView: 0x10e286400> => <RCTView: 0x31f764f60> => <RCTView: 0x31f7652e0> => <RCTView: 0x31f7694a0> => <RNSScreenView: 0x10e13e000> => <UIViewControllerWrapperView: 0x10b913d40> => <UINavigationTransitionView: 0x10b0b12e0> => <UILayoutContainerView: 0x10b0b0f30> => <RNSScreenNavigationContainerView: 0x10b0ad5b0> => <RCTView: 0x10b0c17f0> => <RCTView: 0x10b0c1b70> => <RCTView: 0x10b0c1ef0> => <RNSScreenView: 0x10d235000>)
ios-context-menu-crash.mp4

Minimal repro: https://github.com/rrebase/ios-context-menu-crash-demo

Note: have to precise with the tap + long press timing to cause the crash 馃槃

@rrebase rrebase changed the title iOS crash with NSInternalInconsistencyException: This UITargetedPreview initializer requires that the view is in a window iOS crash with NSInternalInconsistencyException, UITargetedPreview May 14, 2024
@rrebase
Copy link
Author

rrebase commented May 15, 2024

The helpful workaround mentioned here works, but not in all cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant