-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Touchable onPress not working with 3D Touch when 'position: absolute' #13845
Comments
In my case, the View inside the TouchableOpacity doesn't have the position absolute style, but if you press gently enough, it does work, but if you press normally then it doesn't work. I have seen some post in which the solution is to use onPressIn instead, and it does the trick but when you have a bunch of touchables inside a scroll view, then you can't scroll because the onPressIn is called immediately after touched |
@linoleum00 Another related reason why this solution is unsatisfactory is that if you use |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
This is still an issue, and I have reproduced it on React Native v0.47. All the information required is in my original post above. Lack of activity |
This is a big issue still in RN49. Actually this looks like a solution but I guess it would be better to implement that inside RN itself. |
Still an issue in 0.51 |
Yes, its still an issue in 0.51 :( |
react-native: 0.51.0 still not work |
still not working in 0.53.3, no other solutions seem to work for me. |
This is still an issue. |
Issue still exist. |
Still an issue. |
issue still exists on RN 0.55.4, none of the solutions mentioned in other threads are working when TouchableOpactity is rendered inside of |
We noticed that very few people actually use 3D Touch so we recently removed a bunch of features related to it, so I'm going to close this as wontfix. |
Description
I'm trying to consolidate the various issues around this into one place so it can finally be tackled. The related issues I have found are:
#3082 *
#10822
#10386
The issue is that
Touchable*#onPress
doesn't work on iOS devices with 3D Touch, if any pressure is applied, when the component wrapped by theTouchable*
hasposition: 'absolute'
. I think this has to do withtouchmove
events (or equivalent) being triggered by 3D Touch (possibly in thez
direction?). A quick fix is to wrap yourTouchable*
in aView
, giving this outer viewposition: 'absolute'
, and removingposition: 'absolute'
from theView
inside yourTouchable*
.There is a related problem about the same incorrect behaviour applying to
Touchable
s within a ScrollView (see * above) but this involvesPanResponder
and becomes much more complicated. I have a feeling (totally unfounded) that fixing this bug might go some (or all the) way towards fixing that bug.Reproduction Steps and Sample Code
Solution
I think this is a bug and requires either:
Touchable*
should not haveposition: 'absolute'
(but the parent can)react-native
fixAdditional Information
The text was updated successfully, but these errors were encountered: