-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
TouchableHighlight activates wrong button when next to each other #21319
Comments
Hey @bgold0, I tried to reproduce this with your code here and was unable to: https://snack.expo.io/@jonsamp/touchable-highlight-repro It looks like you're using react native version |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
I just upgraded a project from RN 0.54 to 0.57.8 and noticed a similar issue. We have a FlatList with rows, each consist of 5 children: T-s-T-s-T. T=TouchableHighlight which wraps a react-native-circular-progress and an Image With 0.54 it works very well, but with 0.57.8 the "right-most" TouchableHighlight "catches" the touch'es from the left an middle one. I tried to strip this down to a simple demo at snack.expo.io but then I noticed the issue only exists when I used AnimatedCircularProgress or CircularProgress. As soon I just use an Image inside the TouchableHighlight it works well. I would love to share an example, but snack.expo.io doesn't support react-native-circular-progress, no?. |
I can add the following info's:
|
Sorry for spam'ing ... just try to figure it down: A click to the "upper half" of an image seems always behave correct, a click to the lower "half" triggers the wrong touchable: This snippet behaves wrong (i.e. click on the "lower half" of the cross image in the center log "3" in console):
and this one behaves correct:
So I assume, the error is related to the rendering of CircularProgress when added like this:
CircularProgress isn't a native module, so hopefully this is the correct place to submit this error. |
I am also experiencing this problem. I just have four TouchableHighlights in a component, their child is one View whose child is a react-native-svg SVG component. When you click one of the Touchables, one of 3 things will happen:
I am not using CircularProgress, though. |
I am experience both (depending on flex): either a click on the lower half or the the upper half works. |
Is there a known workaround? |
Hi guys even i am facing the same issue, while placing, multiple touchableOpacity icons beside each other, it activates the wrong icon.This is not seen when used with text or touchableOpacity icon when placed one above the other. Pls provide a work around |
Hey everyone, can anyone provide a repro on 0.59? |
I was able to find the solution for my problem,First try touchableOpacity with Icon from react native element library ,and rm -rf node_modules ,npm install, clean build in xcode and build your app again <View key={id} >
<TouchableOpacity style={Styles.iconBG} onPress={() => {
selectedIdentityType(identity.type); }}>
<Icon
name={identity.iconName}
type='font-awesome'
color={identity.iconColor}
onPress={() => { selectedIdentityType(identity.type); }} />
<Text style={[Styles.icontText,{color:"#3E3E3E"}]}>{identity.type}</Text>
</TouchableOpacity>
</View>` The Icon in imported from react native elements |
I think this is an issue with RN 0.56 |
@teamdraftbox are you using RN 0.59? |
iam using RN0.57 |
Ok, but we need to know if it's an issue on the latest stable - can you please provide a repro? |
RN 0.59 works, 0.56 fails |
Closing since this seems to be fixed in the latest RN version. |
Environment
Description
I have a React-Native view where I have to buttons side by side from each other.
What is happening is when I click Back, it does what it is supposed to do:
console.log(-1)
However, when I click on Next, the
console.log
of "Back" is being activated almost 70% of the time and only 30% of the time it shows aconsole.log(+1)
I have no idea why this is happening. Here is a screenshot of what is rendered. Left side is what you see from the code below and the right side is what you see if I add a red border to
styles.footerButtonContainer
.Reproducible Demo
The text was updated successfully, but these errors were encountered: