-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Long press from longPressAndDrag not being detected until after drag is completed #3861
Comments
Thanks for providing the repository for the reproduction. I hope @asafkorem will be able to look at it soon. |
Hi @asafkorem, is there any update on this please? |
Hi @aaulthudl, sorry, I haven't gotten to it yet. I will take a look today or tomorrow. |
I was able to reproduce this issue (using @aaulthudl's repo). Investigating. |
Hey @aaulthudl, thanks for report. Indeed, it looks like there's some conflict with the gesture handling of this library (and its dependency - RN-Gesture-Handler) and Detox, which will require deeper investigation from my end. For the meanwhile, I think I found some workaround for you (please confirm). |
It didn't work for me sadly. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! For more information on bots in this repository, read this discussion. |
This is still required |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! For more information on bots in this repository, read this discussion. |
This is still required |
Is there any update on this issue please? |
Bump on this again please |
Any update regarding this please? |
@asafkorem Any update on this please? |
This is also an issue for us. We need to run longPressAndDrag twice in the test, which can cause test errors related to visibility of the pressable item if a ScaleDecorator is used (e.g. if the pressable item expands and is no longer 100% visible), the second "longPressAnDrag" that is required because of this issue can fail as the item is no longer 100% visible) |
Are there any updates on this please? |
Unfortunately, there isn't a straightforward solution for your case I can point on, though it's possible that something is incorrect on this implementation. Currently, there is no priority or ETA from the Detox team to investigate this issue any deeper. However, we welcome external contributors who are interested in exploring this further. |
Hello! We appreciate you bringing this issue to our attention. If you're interested in contributing to this feature, You're also welcome to join our Discord server Please feel free to reach out to us if you have any questions, or need help with anything. |
What happened?
I have tried to integrate it into a test in my app which involves a draggable flatlist from https://www.npmjs.com/package/react-native-draggable-flatlist. This flatlist has its list items wrapped in
TouchableHighlight
elements withonLongPress={drag}
. When running the tests it seems that it tries to press but it isn't detected by the system, then it does the drag (which doesn't accomplish much). After thelongPressAndDrag
, it looks like a press is then detected.I removed the dependency of
react-native-draggable-flatlist
and logged when theonLongPress
on theTouchableHighlight
is called and it's not called until after thelongPressAndDrag
action finishes. I tried a normallongPress
and that worked as expected and was detected by the system.Disabling/dabbling around with synchronization produced no results.
What was the expected behaviour?
The Detox test interacts with the UI like a user would. Long press is not detected until after the whole action finishes and therefore the drag doesn't result in anything.
Was it tested on latest Detox?
Did your test throw out a timeout?
Help us reproduce this issue!
longPressAndDragRepro
node
(e.g.16.10.0
)yarn install
andyarn setup
to install dependenciesyarn start
to run Metroyarn e2e-build ios.debug
to build for Detoxyarn e2e-run ios.debug
to run the singular test that does thelongPressAndDrag
If you want to run it locally then do:
ios/detoxIssueRepro.xcworkspace
in XcodeIn what environment did this happen?
Detox version: 20.1.0
React Native version: 18.0.0
Has Fabric (React Native's new rendering system) enabled: no
Node version: 16.10.0
Device model: iPhone 14 Pro
iOS version: 12.4
macOS version: 12.6.2 on Apple Silicon
Xcode version: 14.1
Test-runner (select one): jest
Detox logs
Github was returning the error
There was an error creating your Issue: body is too long (maximum is 65536 characters).
when I had the log in here so I put it in pastebin.https://pastebin.com/WBwYve4U
Device logs
Device logs
More data, please!
Untitled.mp4
The text was updated successfully, but these errors were encountered: