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
I have 2 RadialGradients (both absolutely positioned), with .absoluteFill set, so they both fill the entire screen and overlap one another. Each one has a child TouchableOpacity, but the problem is that only the second one is pressable. The first is obstructed by the 2nd, thereby preventing touches from registering. If I use Views instead of RadialGradients, I can pass the prop 'pointerEvents="box-none"', to indicate that the parent view should allow touches to pass through to any element under them. However, this does not work when using RadialGradient. Here's a simple example of the scenario.
Looking at the index.js source for RadialGradient, I found that the NativeRadialGradient element does not accept any props from the parent component. When I add 'pointerEvents="box-none"' directly to NativeRadialGradient (see below), everything works as expected.
<View ref={(component) => { this.gradientRef = component; }} {...otherProps} style={style}>
<NativeRadialGradient
pointerEvents={"box-none"} // adding this line fixes the issue
style={{position: 'absolute', top: 0, left: 0, bottom: 0, right: 0}}
colors={(colors)?colors.map(processColor):null}
center={center}
radius={radius}
stops={stops}
/>
{ children }
</View>
Would it be possible to expose a 'nativeProps' prop to the application, so that we can handle scenarios like this? The library might look like this afterward.
I have 2 RadialGradients (both absolutely positioned), with .absoluteFill set, so they both fill the entire screen and overlap one another. Each one has a child TouchableOpacity, but the problem is that only the second one is pressable. The first is obstructed by the 2nd, thereby preventing touches from registering. If I use Views instead of RadialGradients, I can pass the prop 'pointerEvents="box-none"', to indicate that the parent view should allow touches to pass through to any element under them. However, this does not work when using RadialGradient. Here's a simple example of the scenario.
Looking at the index.js source for RadialGradient, I found that the NativeRadialGradient element does not accept any props from the parent component. When I add 'pointerEvents="box-none"' directly to NativeRadialGradient (see below), everything works as expected.
Would it be possible to expose a 'nativeProps' prop to the application, so that we can handle scenarios like this? The library might look like this afterward.
Thank you!
The text was updated successfully, but these errors were encountered: