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
Fix android_ripple not working with foreground: false in RN 0.82.1 (#54455)
Summary:
Fixes#54372#54298
The `android_ripple` prop on `Pressable` components stopped working in React Native 0.82.1 when `foreground: false` (the default value). This regression was introduced by the new background drawable system.
**Root Cause:** The `setFeedbackUnderlay` method in `BackgroundStyleApplicator.kt` was creating a new `CompositeBackgroundDrawable` with the ripple effect but not assigning it back to the view's background, causing the ripple to be invisible.
**Solution:** Modified the method to properly assign the new composite drawable containing the ripple effect to `view.background`.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix android_ripple not working with foreground: false in Pressable components
Pull Request resolved: #54455
Test Plan:
**Before the fix:** Create a Pressable with android_ripple and foreground: false (default) - no ripple effect appears when pressed.
**After the fix:** The ripple effect works correctly.
Test case:
```jsx
<Pressable
android_ripple={{ color: 'red', borderless: false }}
onPress={() => console.log('Pressed!')}
>
<Text>Press Me</Text>
</Pressable>
Reviewed By: jorge-cab
Differential Revision: D86671603
Pulled By: joevilches
fbshipit-source-id: 71cef114e903a9f807a52a9f3902b85d44bf58b3
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -467,7 +467,7 @@ public object BackgroundStyleApplicator {
0 commit comments