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

[iOS] RectButton does not trigger onPress when nested inside ReanimatedSwippeable #3217

Open
focux opened this issue Nov 15, 2024 · 3 comments
Assignees
Labels
Can repro It is confirmed we can reproduce the issue Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@focux
Copy link

focux commented Nov 15, 2024

Description

When RectButton is nested inside ReanimatedSwippeable, it does not trigger the onPress callback unless you long
press.

Screen.Recording.2024-11-15.at.4.27.39.PM.mov

Steps to reproduce

  1. Put a RectButton inside a ReanimatedSwipeable and try to trigger the onPress callback.

Snack or a link to a repository

https://github.com/focux/expo-rect-swipeable-bug

Gesture Handler version

2.21.0

React Native version

0.74.5

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo bare workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided Platform: iOS This issue is specific to iOS labels Nov 15, 2024
@latekvo latekvo added the Can repro It is confirmed we can reproduce the issue label Nov 20, 2024
@latekvo latekvo self-assigned this Nov 20, 2024
@LekZ974
Copy link

LekZ974 commented Dec 9, 2024

same here :/ any solution?

@dpyeates
Copy link

dpyeates commented Dec 10, 2024

Also seeing this using "react-native-gesture-handler": "^2.21.2"

@latekvo
Copy link
Contributor

latekvo commented Dec 11, 2024

Hey, could you please confirm this issue still occurs on the latest Gesture Handler release (2.22.0-rc.0)?
I recall i reproed this issue successfully in the past, but I can't get the issue to occur anymore.
I tested it on the following repro:

Collapsed code
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { RectButton } from 'react-native-gesture-handler';

import Swipeable from 'react-native-gesture-handler/ReanimatedSwipeable';

export default function EmptyExample() {
  return (
    <View style={styles.container}>
      <Swipeable containerStyle={styles.swipeable}>
        <RectButton
          style={styles.button}
          onPress={() => console.log('Pressed: RectButton inside Swipeable')}
          rippleColor={'tomato'}>
          <Text>RectButton inside Swipeable</Text>
        </RectButton>
      </Swipeable>
      <View style={styles.swipeable}>
        <RectButton
          style={styles.button}
          onPress={() => console.log('Pressed: RectButton inside View')}
          rippleColor={'tomato'}>
          <Text>RectButton inside View</Text>
        </RectButton>
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
    gap: 20,
  },
  button: {
    width: 210,
    height: 50,
    backgroundColor: 'pink',
    alignItems: 'center',
    justifyContent: 'center',
  },
  swipeable: {
    width: 400,
    height: 60,
    backgroundColor: 'orange',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

And onPress was working as expected.

Also, the repro you provided 404s, it's either private or unavailable anymore. If this issue persists, could you please send the minimal reproduction here, or set your repo to public?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can repro It is confirmed we can reproduce the issue Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

4 participants