Skip to content

Commit 07c0539

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Remove shouldResetClickableWhenRecyclingView feature flag (#55106)
Summary: Pull Request resolved: #55106 Changelog: [Android][Fixed] - Reset isClickable to false when recycling views to avoid accessibility tools finding views with incorrect state --- This diff removes the `shouldResetClickableWhenRecyclingView` feature flag since it has been tested in FB4A for a month with `defaultValue: true`. The flag was introduced to reset `isClickable` to false when recycling views on Android to avoid accessibility tools finding views with incorrect state after recycling. This behavior is now the default. Changes: - Removed the flag definition from `ReactNativeFeatureFlags.config.js` - Removed the conditional check in `BaseViewManager.java`, now `view.setClickable(false)` is always called unconditionally - Regenerated all feature flag files via `js1 featureflags --update` Reviewed By: javache Differential Revision: D90380899 fbshipit-source-id: df604556d3b1f6c108c4defe343f1ab6683f0ce0
1 parent 20319bd commit 07c0539

21 files changed

+37
-155
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<b9a49024788f6d78e8bce1d8d7a00f16>>
7+
* @generated SignedSource<<01a8372ee4b908995e2c70eb7a972a39>>
88
*/
99

1010
/**
@@ -414,12 +414,6 @@ public object ReactNativeFeatureFlags {
414414
@JvmStatic
415415
public fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean = accessor.shouldPressibilityUseW3CPointerEventsForHover()
416416

417-
/**
418-
* Reset isClickable to false when recycling views on Android to avoid accessibility tools finding views with incorrect state after recycling.
419-
*/
420-
@JvmStatic
421-
public fun shouldResetClickableWhenRecyclingView(): Boolean = accessor.shouldResetClickableWhenRecyclingView()
422-
423417
/**
424418
* Reset OnClickListener to null when recycling views on Android to avoid accessibility tools finding views with incorrect state after recycling.
425419
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a45409be422bc544a43295eb4fe21074>>
7+
* @generated SignedSource<<397c978a91e1815389ce7162d7ce0181>>
88
*/
99

1010
/**
@@ -84,7 +84,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
8484
private var preparedTextCacheSizeCache: Double? = null
8585
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
8686
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
87-
private var shouldResetClickableWhenRecyclingViewCache: Boolean? = null
8887
private var shouldResetOnClickListenerWhenRecyclingViewCache: Boolean? = null
8988
private var shouldSetEnabledBasedOnAccessibilityStateCache: Boolean? = null
9089
private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
@@ -678,15 +677,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
678677
return cached
679678
}
680679

681-
override fun shouldResetClickableWhenRecyclingView(): Boolean {
682-
var cached = shouldResetClickableWhenRecyclingViewCache
683-
if (cached == null) {
684-
cached = ReactNativeFeatureFlagsCxxInterop.shouldResetClickableWhenRecyclingView()
685-
shouldResetClickableWhenRecyclingViewCache = cached
686-
}
687-
return cached
688-
}
689-
690680
override fun shouldResetOnClickListenerWhenRecyclingView(): Boolean {
691681
var cached = shouldResetOnClickListenerWhenRecyclingViewCache
692682
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<645d8233955b21a3b2d4e822976abd35>>
7+
* @generated SignedSource<<4f4cfab3f3d91fba4ea661a17dca0cb9>>
88
*/
99

1010
/**
@@ -156,8 +156,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
156156

157157
@DoNotStrip @JvmStatic public external fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean
158158

159-
@DoNotStrip @JvmStatic public external fun shouldResetClickableWhenRecyclingView(): Boolean
160-
161159
@DoNotStrip @JvmStatic public external fun shouldResetOnClickListenerWhenRecyclingView(): Boolean
162160

163161
@DoNotStrip @JvmStatic public external fun shouldSetEnabledBasedOnAccessibilityState(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<d08d1352bfe98e3e84e58ab9ad2e70c6>>
7+
* @generated SignedSource<<c6f0c4d72a9ef24f5352976996a5e300>>
88
*/
99

1010
/**
@@ -151,8 +151,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
151151

152152
override fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean = false
153153

154-
override fun shouldResetClickableWhenRecyclingView(): Boolean = true
155-
156154
override fun shouldResetOnClickListenerWhenRecyclingView(): Boolean = true
157155

158156
override fun shouldSetEnabledBasedOnAccessibilityState(): Boolean = true

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<5ad99dd8a367e7f12d68c9ef1a52cb56>>
7+
* @generated SignedSource<<77669091f5fbd91a7be1693375163c0c>>
88
*/
99

1010
/**
@@ -88,7 +88,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
8888
private var preparedTextCacheSizeCache: Double? = null
8989
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
9090
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
91-
private var shouldResetClickableWhenRecyclingViewCache: Boolean? = null
9291
private var shouldResetOnClickListenerWhenRecyclingViewCache: Boolean? = null
9392
private var shouldSetEnabledBasedOnAccessibilityStateCache: Boolean? = null
9493
private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
@@ -746,16 +745,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
746745
return cached
747746
}
748747

749-
override fun shouldResetClickableWhenRecyclingView(): Boolean {
750-
var cached = shouldResetClickableWhenRecyclingViewCache
751-
if (cached == null) {
752-
cached = currentProvider.shouldResetClickableWhenRecyclingView()
753-
accessedFeatureFlags.add("shouldResetClickableWhenRecyclingView")
754-
shouldResetClickableWhenRecyclingViewCache = cached
755-
}
756-
return cached
757-
}
758-
759748
override fun shouldResetOnClickListenerWhenRecyclingView(): Boolean {
760749
var cached = shouldResetOnClickListenerWhenRecyclingViewCache
761750
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<98babc53e50f8ec8b9e324727ed3734b>>
7+
* @generated SignedSource<<da8de211c4b7837291853f9b79d2f8e5>>
88
*/
99

1010
/**
@@ -151,8 +151,6 @@ public interface ReactNativeFeatureFlagsProvider {
151151

152152
@DoNotStrip public fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean
153153

154-
@DoNotStrip public fun shouldResetClickableWhenRecyclingView(): Boolean
155-
156154
@DoNotStrip public fun shouldResetOnClickListenerWhenRecyclingView(): Boolean
157155

158156
@DoNotStrip public fun shouldSetEnabledBasedOnAccessibilityState(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ public BaseViewManager(@Nullable ReactApplicationContext reactContext) {
154154
if (ReactNativeFeatureFlags.shouldResetOnClickListenerWhenRecyclingView()) {
155155
view.setOnClickListener(null);
156156
}
157-
if (ReactNativeFeatureFlags.shouldResetClickableWhenRecyclingView()) {
158-
view.setClickable(false);
159-
}
157+
view.setClickable(false);
160158
view.setFocusable(false);
161159
view.setFocusableInTouchMode(false);
162160

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<3369c6073006f4dddb297f86f413363f>>
7+
* @generated SignedSource<<212a64efdf912e89b8330b292a8bccb5>>
88
*/
99

1010
/**
@@ -423,12 +423,6 @@ class ReactNativeFeatureFlagsJavaProvider
423423
return method(javaProvider_);
424424
}
425425

426-
bool shouldResetClickableWhenRecyclingView() override {
427-
static const auto method =
428-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("shouldResetClickableWhenRecyclingView");
429-
return method(javaProvider_);
430-
}
431-
432426
bool shouldResetOnClickListenerWhenRecyclingView() override {
433427
static const auto method =
434428
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("shouldResetOnClickListenerWhenRecyclingView");
@@ -849,11 +843,6 @@ bool JReactNativeFeatureFlagsCxxInterop::shouldPressibilityUseW3CPointerEventsFo
849843
return ReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover();
850844
}
851845

852-
bool JReactNativeFeatureFlagsCxxInterop::shouldResetClickableWhenRecyclingView(
853-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
854-
return ReactNativeFeatureFlags::shouldResetClickableWhenRecyclingView();
855-
}
856-
857846
bool JReactNativeFeatureFlagsCxxInterop::shouldResetOnClickListenerWhenRecyclingView(
858847
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
859848
return ReactNativeFeatureFlags::shouldResetOnClickListenerWhenRecyclingView();
@@ -1157,9 +1146,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
11571146
makeNativeMethod(
11581147
"shouldPressibilityUseW3CPointerEventsForHover",
11591148
JReactNativeFeatureFlagsCxxInterop::shouldPressibilityUseW3CPointerEventsForHover),
1160-
makeNativeMethod(
1161-
"shouldResetClickableWhenRecyclingView",
1162-
JReactNativeFeatureFlagsCxxInterop::shouldResetClickableWhenRecyclingView),
11631149
makeNativeMethod(
11641150
"shouldResetOnClickListenerWhenRecyclingView",
11651151
JReactNativeFeatureFlagsCxxInterop::shouldResetOnClickListenerWhenRecyclingView),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<818d29b2da08e64cec4d20e4b541b7cc>>
7+
* @generated SignedSource<<010228a95e878a109f1aa3d13a0c7606>>
88
*/
99

1010
/**
@@ -222,9 +222,6 @@ class JReactNativeFeatureFlagsCxxInterop
222222
static bool shouldPressibilityUseW3CPointerEventsForHover(
223223
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
224224

225-
static bool shouldResetClickableWhenRecyclingView(
226-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
227-
228225
static bool shouldResetOnClickListenerWhenRecyclingView(
229226
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
230227

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<97daf46fe8af38d7af4b7241d1d3bc4e>>
7+
* @generated SignedSource<<8fa338ec73fcb7af019d877fd949543a>>
88
*/
99

1010
/**
@@ -282,10 +282,6 @@ bool ReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover() {
282282
return getAccessor().shouldPressibilityUseW3CPointerEventsForHover();
283283
}
284284

285-
bool ReactNativeFeatureFlags::shouldResetClickableWhenRecyclingView() {
286-
return getAccessor().shouldResetClickableWhenRecyclingView();
287-
}
288-
289285
bool ReactNativeFeatureFlags::shouldResetOnClickListenerWhenRecyclingView() {
290286
return getAccessor().shouldResetOnClickListenerWhenRecyclingView();
291287
}

0 commit comments

Comments
 (0)