Skip to content

Commit 21b93d8

Browse files
fabriziocuccimeta-codesync[bot]
authored andcommitted
Flip default value for shouldResetOnClickListenerWhenRecyclingView (#54647)
Summary: Pull Request resolved: #54647 Changelog: [Android][Fixed] – Enabled shouldResetOnClickListenerWhenRecyclingView by default to reset OnClickListener to null when recycling views and prevent accessibility tools from detecting incorrect states. Reviewed By: javache Differential Revision: D87778728 fbshipit-source-id: 669bad3eed6aa99acd1d5850cb94d8c0013d2797
1 parent 40029b3 commit 21b93d8

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 2 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<<c7c15289a7da56ef403691768489b6f6>>
7+
* @generated SignedSource<<84ba3f1d280afc3636f32952cc906579>>
88
*/
99

1010
/**
@@ -165,7 +165,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
165165

166166
override fun shouldResetClickableWhenRecyclingView(): Boolean = true
167167

168-
override fun shouldResetOnClickListenerWhenRecyclingView(): Boolean = false
168+
override fun shouldResetOnClickListenerWhenRecyclingView(): Boolean = true
169169

170170
override fun shouldSetEnabledBasedOnAccessibilityState(): Boolean = true
171171

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h

Lines changed: 2 additions & 2 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<<14228fac25bcaaf06f437b5805ef04ce>>
7+
* @generated SignedSource<<3ed1bd5b83694d078de26f2c65214fac>>
88
*/
99

1010
/**
@@ -312,7 +312,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
312312
}
313313

314314
bool shouldResetOnClickListenerWhenRecyclingView() override {
315-
return false;
315+
return true;
316316
}
317317

318318
bool shouldSetEnabledBasedOnAccessibilityState() override {

packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ const definitions: FeatureFlagDefinitions = {
806806
ossReleaseStage: 'none',
807807
},
808808
shouldResetOnClickListenerWhenRecyclingView: {
809-
defaultValue: false,
809+
defaultValue: true,
810810
metadata: {
811811
description:
812812
'Reset OnClickListener to null when recycling views on Android to avoid accessibility tools finding views with incorrect state after recycling.',

packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js

Lines changed: 2 additions & 2 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<<0559a11a2edeec64fbc00451614e98d9>>
7+
* @generated SignedSource<<a324a12013cfab0e52bcdbbea6c6424e>>
88
* @flow strict
99
* @noformat
1010
*/
@@ -516,7 +516,7 @@ export const shouldResetClickableWhenRecyclingView: Getter<boolean> = createNati
516516
/**
517517
* Reset OnClickListener to null when recycling views on Android to avoid accessibility tools finding views with incorrect state after recycling.
518518
*/
519-
export const shouldResetOnClickListenerWhenRecyclingView: Getter<boolean> = createNativeFlagGetter('shouldResetOnClickListenerWhenRecyclingView', false);
519+
export const shouldResetOnClickListenerWhenRecyclingView: Getter<boolean> = createNativeFlagGetter('shouldResetOnClickListenerWhenRecyclingView', true);
520520
/**
521521
* Fix BaseViewManager to properly set view.setEnabled() based on accessibilityState.disabled.
522522
*/

0 commit comments

Comments
 (0)