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

Gesture conflict on Android #43

Open
BLOCKMATERIAL opened this issue Jan 12, 2022 · 6 comments
Open

Gesture conflict on Android #43

BLOCKMATERIAL opened this issue Jan 12, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@BLOCKMATERIAL
Copy link

BLOCKMATERIAL commented Jan 12, 2022

When there is a ContextMenu in which there is a Pressable component, after releasing a finger long press Pressable or TouchebleOpacity is triggered, which is inside

Platform: Only Android.

Example Code

        <ContextMenu
          actions={[{title: 'Title 1'}, {title: 'Title 2'}]}
          onPress={e => {
            console.warn(
              `Pressed ${e.nativeEvent.name} at index ${e.nativeEvent.index}`,
            );
          }}>
          <TouchableOpacity
            onPress={() => {console.log("Image opened")}}
            style={{backgroundColor: 'green', borderRadius: 30, padding: 20}}>
            <Text>Open image</Text>
          </TouchableOpacity>
        </ContextMenu>

Gif Reproduce
ezgif-5-2308a0b239
Video Reproduce
https://user-images.githubusercontent.com/46076319/149196136-56d23215-9f3d-43c6-a4d9-4f724add763f.mov

How can I fix it?
@maartenvanvliet @alessandrod @mpiannucci @jacobp100 @mrousavy

@BLOCKMATERIAL
Copy link
Author

BLOCKMATERIAL commented Feb 10, 2022

found a workaround, add to Pressable or TouchebleOpacity.
onLongPress={() => return null}

@mpiannucci
Copy link
Owner

Leaving this up for posterity

@mpiannucci mpiannucci added the bug Something isn't working label Apr 18, 2022
@fukemy
Copy link

fukemy commented Apr 22, 2022

i have other problem, im using ImageModel to show image, sometime when context menu showed the image is show as transparent

@nandorojo
Copy link

Just to clarify, is this issue staying up because we should use the workaround, or will there be an expected fix? I maintain a library that wraps this one (zeego), so I just want to know if I should include this workaround in the docs. Thanks!

@mpiannucci
Copy link
Owner

I have left this up because the workaround works for people. I have not personally tested it on android so it isnt fixed yet.

If the workaround is solid i would be happy to review and test a PR

xmflsct added a commit to tooot-app/app that referenced this issue Nov 17, 2022
@FernandoLooplan
Copy link

I have the same problem on ios and I have already added
onLongPress={() => null}

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