Gradient Button doesn't show visual onPress like regular button
See original GitHub issueExplain 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)
- yarn add react-native-web-linear-gradient
- copy above code in your project
- Click the button
Screenshots (Required)
Your Environment (Required):
software | version |
---|---|
react-native-elements | ^0.18.0 |
react-native | 0.62.2 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
LinearGradient and onPress for navigation - Stack Overflow
Well now realizing LinearGradient does not work with onPress...How should I go about navigating that linearGradient to another page? import ...
Read more >Creating complex gradients with react-native-linear-gradient
Gradients can come in handy when you want to create multi-color backgrounds or custom buttons, adding visual interest to your UI and guiding ......
Read more >Button · React Native Paper
A button is component that the user can press to trigger an action.
Read more >How To Create Buttons in Unity | Beginner UI Tutorial - YouTube
How do you create and script a button ? Do you want to use the OnClick () Unity event? We'll go through that...
Read more >The Button element - HTML: HyperText Markup Language
The <button> HTML element is an interactive element activated by a user with ... Buttons that only show an icon to represent do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 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 toGradient
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.