From ca077c6bf8e1c842857878deb153b1fdbc71b1a2 Mon Sep 17 00:00:00 2001 From: Ishita SIngh Date: Tue, 11 Nov 2025 13:21:49 -0800 Subject: [PATCH] Fix android_ripple not working with foreground: false in RN 0.82.1 (#54455) Summary: Fixes https://github.com/facebook/react-native/issues/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: [ANDROID] [FIXED] - Fix android_ripple not working with foreground: false in Pressable components Pull Request resolved: https://github.com/facebook/react-native/pull/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 console.log('Pressed!')} > Press Me Reviewed By: jorge-cab Differential Revision: D86671603 Pulled By: joevilches fbshipit-source-id: 71cef114e903a9f807a52a9f3902b85d44bf58b3 --- .../com/facebook/react/uimanager/BackgroundStyleApplicator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt index 82b778368de..6fa57f5aeae 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt @@ -467,7 +467,7 @@ public object BackgroundStyleApplicator { */ @JvmStatic public fun setFeedbackUnderlay(view: View, drawable: Drawable?) { - ensureCompositeBackgroundDrawable(view).withNewFeedbackUnderlay(drawable) + view.background = ensureCompositeBackgroundDrawable(view).withNewFeedbackUnderlay(drawable) } /**