React-native: TouchableOpacity no longer shows opacity tap effects on 0.63.0

Created on 13 Jul 2020  路  9Comments  路  Source: facebook/react-native

Description

TouchableOpacity no longer shows opacity tap effects on 0.63.0

React Native version:

0.63.0

Steps To Reproduce

  1. See opacity effects with <TouchableOpacity /> on 0.62.2
  2. See NO opacity effects with <TouchableOpacity /> on 0.63.0

Expected Results

Opacity effects work

Snack, code example, screenshot, or link to a repository:

    <TouchableOpacity
      disabled={disabled}
      onLongPress={onLongPressHandler}
      onPress={onPressHandler}
      style={style}
      testID={testID}>
      {children}
    </TouchableOpacity>
TouchableOpacity Needs

Most helpful comment

any update on this?
I can confirm that adding delayPressIn={0} fix the issue so we could use that until they have fixed it.

I had the same problem. Adding delayPressIn={0} fixed for me!

All 9 comments

Confirm this as well on 0.63.0

Can you test setting delayPressIn={0} ? I think this is the same issue I'm seeing with onPressIn not firing as before (it won't fire due to some new default value for the delay prop)

This repros for us in 0.63.1 as well. This is extremely important - not having any button feedback means we can't launch this version of the app.

Can confirm the delayPressIn solution from @cristianoccazinsp works but it's a hack to apply that to every button (and of course quite non-obvious). Looks like a fairly severe bug in 0.63.x.

For me too. They should have left Touchables alone and worked on Pressables only.

any update on this?
I can confirm that adding delayPressIn={0} fix the issue so we could use that until they have fixed it.

You can use my snack url that I have created for the issue that I have closed.

any update on this?
I can confirm that adding delayPressIn={0} fix the issue so we could use that until they have fixed it.

I had the same problem. Adding delayPressIn={0} fixed for me!

No need to add delayPressIn={0} to every TouchableOpacity. Just add the following code to your root component's componentDidMount.

if (TouchableOpacity.defaultProps == null) TouchableOpacity.defaultProps = {};
TouchableOpacity.defaultProps.delayPressIn = 0;
Was this page helpful?
0 / 5 - 0 ratings

Related issues

aniss picture aniss  路  3Comments

janmonschke picture janmonschke  路  3Comments

axelg12 picture axelg12  路  3Comments

lazywei picture lazywei  路  3Comments

madwed picture madwed  路  3Comments