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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressables not working after context menu opened #24

Open
mrousavy opened this issue Feb 11, 2021 · 6 comments
Open

Pressables not working after context menu opened #24

mrousavy opened this issue Feb 11, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@mrousavy
Copy link
Contributor

mrousavy commented Feb 11, 2021

When wrapping Pressables (<Pressable>, <TouchableOpacity>, ...) with a context menu, the entire JS responder system will fail/crash once you open the context menu once. In other words, your entire screen becomes unresponsive if you open a context menu that contains a pressable.

There might be some extra treatment required to support inlining the JS pressability API.

(Also, it looks like native buttons such as the back button from react-native-navigation are still working, it's just the current screen that "freezes"/doesn't trigger onPress events anymore)

Screen.Recording.2021-01-18.at.10.49.40.mov

Code:

return (
  <View style={styles.container}>
    <ContextMenu onPress={onContextActionPressed} actions={ACTIONS}>
      <Pressable style={styles.imageContainer} onPress={onImagePressed}>
        <FastImage
          style={styles.image}
          source={imageSource}
        />
      </Pressable>
    </ContextMenuView>
  </View>
);
@mpiannucci
Copy link
Owner

Whoa I'll have to check this out for sure. Thanks for the bug report!

@mpiannucci mpiannucci added the bug Something isn't working label Feb 12, 2021
@fukemy
Copy link

fukemy commented Apr 22, 2022

i have same problem, did u solved this?

@margox
Copy link

margox commented Jun 28, 2023

Still happens sometimes

@fukemy
Copy link

fukemy commented Jun 29, 2023

Still happens sometimes

try to use rn ios context menu view its much better

@mpiannucci
Copy link
Owner

I think this is because the native UIControl hijacks the press event no matter what on iOS. Not sure tho

@tn
Copy link

tn commented Feb 2, 2024

Still happens. Also here is error message that follows this behavior (if you are trying to navigate somewhere after screen freezing)

[UIKitCore] Attempt to present <RNSScreen: 0x109f44000> on <UIViewController: 0x109233270> (from <RNScreensNavigationController: 0x10b178000>) which is
already presenting <_UIContextMenuActionsOnlyViewController: 0x108307e30>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants