View's touch nativeEvent
doesn't provide correct pageY
value with respect to the window/screen area
#1522
Labels
nativeEvent
doesn't provide correct pageY
value with respect to the window/screen area
#1522
Environment
Steps to reproduce the bug
I recently tried a animation sample on rn-macos, and noticed a unexpected behaviour in compare to other 4 platforms I ran the implementation on, it is related to the measured events we get for a view with respect to the rendered screen area/window, when it is first rendered and one from the touch event on the view, as they are comparably different.
Expected Behavior
I expect it to provide the data in similar way as I get on other platforms, especially rn-windows desktop app, as it is much closer to macos compared to mobile and web.
It should not consider the title and tab bar in
pageY
value in case of touch events, though I'm not really sure if this is a expected behaviour here, but even if it is, is there any way to get title bar height in rn-macos, or also to know if "show tab bar" is enabled, to workaround this?Actual Behavior
The above mentioned example here is this one, where I'm doing a gesture based toolbar animation, and for that:
measure
function here, which is giving mepageY
value for 40, which is correct as this is the margin top I've applied herepageY
fromnativeEvent
, I'm comparing the two and activating the toolbar's button based on that.Now on the first case I'm getting the supposedly expected value, but in the second, in touch events, I'm getting

pageY
value as the margin top (40) + title bar height, which is then around ~70.see the image below
and this is causing inconsistency with the animation, as compared to other platforms, even on rn-windows.
Now if you enable to tab bar option from menu bar -> view -> 'show tab bar'


it's gonna also consider this tab bar's height in the
pageY
value I get from the touch events, which is then gonna be somewhere around ~97.Let me know if any more details is required.
Reproducible Demo
for repro you can try the sample here, as this is where I faced this problem, the project also contains other platform modules, so you can try them out and compare the results.
Additional context
I searched the existing issue to see anything related, and the PR #1288 seems somewhat related, though I'm not sure if the mentioned issue is really fixed here in case of touch events, as for some reason I'm getting the
location(X/Y)
andpage(X/Y)
values same, as you can see in the screenshotThe text was updated successfully, but these errors were encountered: