You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React Native pressables don't seem to prevent the touches from being forwarded to the OS. This results in unexpected behavior in some situations.
e.g. on iPadOS, there is a large area at the top of the screen that can be tapped to scroll to the top. This area usually covers a similar height to the header bar. If headers have buttons that use pressables, the pressable handles the action, but iPadOS also handles the touch and scrolls any scrollview in the screen to the top.
This does not happen when using a native control (e.g., with UIControl), and only happens with React Native's Pressable. It is very common to add custom buttons to the header (even when using native stack and native header), many people also use custom headers. So the unexpected scroll to top results in a bad UX.
I'm not aware of a way to prevent this behavior right now.
Steps to reproduce
Install the app on iPad simulator with yarn ios
Scroll the scrollview so it's not at the top
Click on the button in the header
Observe that the button also scrolls the scrollview to the top
Description
React Native pressables don't seem to prevent the touches from being forwarded to the OS. This results in unexpected behavior in some situations.
e.g. on iPadOS, there is a large area at the top of the screen that can be tapped to scroll to the top. This area usually covers a similar height to the header bar. If headers have buttons that use pressables, the pressable handles the action, but iPadOS also handles the touch and scrolls any scrollview in the screen to the top.
This does not happen when using a native control (e.g., with
UIControl), and only happens with React Native's Pressable. It is very common to add custom buttons to the header (even when using native stack and native header), many people also use custom headers. So the unexpected scroll to top results in a bad UX.I'm not aware of a way to prevent this behavior right now.
Steps to reproduce
yarn iosReact Native Version
0.84.1
Affected Platforms
Runtime - iOS
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/satya164/iPadTouchableRepro
Screenshots and Videos
ipad-header-touch.mp4