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

Gradient Button doesn't show visual onPress like regular button #2493

Closed
thijssmudde opened this issue Aug 9, 2020 · 10 comments · Fixed by #2587
Closed

Gradient Button doesn't show visual onPress like regular button #2493

thijssmudde opened this issue Aug 9, 2020 · 10 comments · Fixed by #2587
Labels
📥 PR Submitted Pull request has been submitted to resolve this issue
Milestone

Comments

@thijssmudde
Copy link

thijssmudde commented Aug 9, 2020

Explain what you did (Required)

Created a gradient button. See example here:

import LinearGradient from 'react-native-web-linear-gradient'
import React from 'react'

<Button
  title={'TITLE'}
  onPress={onPress}
  ViewComponent={LinearGradient}
  linearGradientProps={{
    colors: ['#FFF', '#333'],
    start: { x: 0, y: 0 },
    end: { x: 0, y: 1 },
  }}
/>

Expected behavior (Required)

When pressing the button onPress is fired, but the user does not get any tactile feedback. See image. The Strava button works fine, but the Continue button does not give any feedback to the user whatsoever.

Describe the bug (Required)

It appears that once you add linearGradientProps the button does no longer provide feedback to the user.

To Reproduce (Required)

  1. yarn add react-native-web-linear-gradient
  2. copy above code in your project
  3. Click the button

Screenshots (Required)

image

Your Environment (Required):

software version
react-native-elements ^0.18.0
react-native 0.62.2
@supermar1010
Copy link

I have a similiar problem. For me it works as expected on iOS but not on Android. On android the ripple effect is missing. I didn't try web

@flyingcircle
Copy link
Collaborator

Any reason that you are using such an old version of RNE? Can you please verify that it still happens in at least v1.2.7?

@supermar1010
Copy link

supermar1010 commented Aug 11, 2020

For me this issue also happens with the newest RNE

software version
react-native-elements 2.2.0
react-native 0.61.5

I'm gonna update react-native this week to 0.63.

@supermar1010
Copy link

I updated to react-native 0.63, now everything is broken and the button still has no ripple effect

@flyingcircle
Copy link
Collaborator

RN 63 now has a Pressable component that may be worthwhile using in place of the Touchable component. @supermar1010 can you try setting TouchableComponent to Pressable and see if that fixes the android issue?

@supermar1010
Copy link

supermar1010 commented Aug 13, 2020

I just tried that, doesn't work as well, there's no ripple effect on either android or iOS. Here's a small demo project its basically a new reactnative project with RNE, RN-linear-gradient and rn-vector-icons. The touchable component is commented out right now, because I tested both.
testgradientbuttonwithoutnodemodules.zip
The new Pressable has in it's default setting no ripple effect, but I have to pass a ripple config but in the button, I did not find a way to do that.

@supermar1010
Copy link

Any update on this issue?

@flyingcircle
Copy link
Collaborator

@supermar1010 this is an open source project. The fastest way to a resolution and fix is to submit your own PR. You can wait for someone else or me to fix it, but that can realistically take months.

@supermar1010
Copy link

Do you have any suggestion/hint how to fix this? I would do it, but I'm a bit lost how to do it.

@flyingcircle
Copy link
Collaborator

@supermar1010 A good place to start would be to look at maybe the react-native issue history to see if they had to deal with a similar issue, or perhaps any issues related to Gradient itself that might be related to Android. I haven't really used gradient in my own apps, so I'm not too familiar with what libraries are all exactly involved.

@flyingcircle flyingcircle added this to the 3.0.0 milestone Sep 3, 2020
@pranshuchittora pranshuchittora added the 📥 PR Submitted Pull request has been submitted to resolve this issue label Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📥 PR Submitted Pull request has been submitted to resolve this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants