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

Invalid behavior Pressable in ScrollView #30563

Closed
jfrolich opened this issue Dec 10, 2020 · 5 comments
Closed

Invalid behavior Pressable in ScrollView #30563

jfrolich opened this issue Dec 10, 2020 · 5 comments
Labels
Component: ScrollView Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@jfrolich
Copy link

Description

The delayPressIn was set to 0 in this commit. 86ffb9c. This removes the delay for pressing a button. This is fine if the button is not in a ScrollView but this delay is designed to not trigger pressIn while scrolling (see native iOS touchables). So basically every Pressable that's being used in a ScrollView has invalid behavior.

React Native version:

0.63.4

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Put a pressable in a ScrollView
  2. Try to scroll above a button
  3. The button triggers

Expected Results

There should be a way to set this delay (it is delayPressIn is not available on the Pressable component). I think it best to:

  • Set the default back to 130ms
  • make the delay configurable on the Pressable component

This is because in my experience most Pressables are part of a ScrollView, and if they're not part of a ScrollView, the small delay is unnoticeable (it might even be the same for native controls). If a delay of 130ms is not acceptable (perhaps in a game scenario or something like that) it can be configured.

@andreialecu
Copy link

andreialecu commented Sep 2, 2021

There's some related discussion in #29376 where the regression was reported.

The change to 0 is actually important.

A lot of UI pressables are NOT in scrollviews. Consider the back button for navigation. Prior to the aforementioned change there would be no feedback for when it was pressed, because the delay was too long before the new screen slid in.

An unstable_pressDelay property does exist on Pressable (although it's not on the Typescript types), documented here: #29376 (comment)

@stale
Copy link

stale bot commented Jan 9, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 9, 2022
@github-actions
Copy link

github-actions bot commented Oct 2, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Oct 2, 2023
@Firesoul18
Copy link

Does anyone have answer for this problem. I have a Pressable in ScrollView, but the pressable doesn't let me scroll because the scroll trigers the press event

@GaylordP
Copy link

GaylordP commented Jul 12, 2024

Hello @Firesoul18 , @jfrolich :)

I have exactly the same problem (I've already asked the question here, but no relevant answer). Have you found a solution?

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ScrollView Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants