software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

Get wrong, negative value from e.absoluteY on Android #2816

Closed doublelam closed 8 months ago

doublelam commented 8 months ago

Description

image

Different platforms behave differently. I got a negative value when I moved the pointer to the top of the screen on Android but got 0 for iOS. I need this value to calculate if the pointer is in a specified element area, so when I use this value to compare with a pageY value, it gives a wrong result.

PS: I found that normally the value varies on ios and Android makes sense because StatusBar occupied some height on Android. But when StatusBar is set to translucent, the value is not correct enough anymore.

Steps to reproduce

Just get an absoluteY value from onUpdate function

Snack or a link to a repository

null

Gesture Handler version

2.13.1

React Native version

0.72.6

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 8 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?