Commit 7b9b99b
Fix android_ripple not working with foreground: false in RN 0.82.1 (#54455)
Summary:
Fixes facebook/react-native#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: facebook/react-native#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: 71cef114e903a9f807a52a9f3902b85d44bf58b31 parent ea356c3 commit 7b9b99b
File tree
1 file changed
+1
-1
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
470 | | - | |
| 470 | + | |
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| |||
0 commit comments