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

The dragging coordinates do not follow the mouse or finger when scrolling the FlashList. #3190

Open
MJRT opened this issue Oct 28, 2024 · 1 comment
Labels
Close when stale The issue will be closed automatically if it remains inactive Platform: Android This issue is specific to Android Platform: Web Repro provided A reproduction with a snack or repo is provided

Comments

@MJRT
Copy link
Contributor

MJRT commented Oct 28, 2024

Description

I want to implement scrolling the list when list item is dragging to list edge, but dragging item's translateY is unexpected, it should have same coordinates with mouse or finger.

It can reproduce on web and android, but I guess same on iOS.

test

Steps to reproduce

https://github.com/MJRT/translationXY-unexpected-at-scrolling

Snack or a link to a repository

https://github.com/MJRT/translationXY-unexpected-at-scrolling

Gesture Handler version

2.19.0

React Native version

0.75.4

Platforms

Android, Web

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Platform: Web Repro provided A reproduction with a snack or repo is provided labels Oct 28, 2024
@latekvo
Copy link
Contributor

latekvo commented Oct 29, 2024

Hi @MJRT,
Thank you for reporting this issue.

I believe the behaviour visible in the attached video is expected and not a bug.
The dragged element is attached to its moving parent and not to the mouse pointer.
If you aren't actively compensating for the movement of the parent by translating the element in the reverse direction of the parent's translation, it is expected for the child to follow its parent's position.

As far as I see, in the code repro you provided, you're adjusting the element's position only by the mouse movements.
To fix this issue, you need to also adjust it by the scrolling offset.

@latekvo latekvo added the Close when stale The issue will be closed automatically if it remains inactive label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale The issue will be closed automatically if it remains inactive Platform: Android This issue is specific to Android Platform: Web Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

2 participants