mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fix broken focus behavior for TextInput in older Android versions (< 9) (#51964)
This commit is contained in:
1 parent
e386b01a8f
commit
0ebaaed281
22 files changed
+47
-180
No files matched your search
+1
-7
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<b263bdcbc1258f7d5c56e69732ba9076>>
|
||||
* @generated SignedSource<<fa641112b3a8888ba2b24cf8829e9382>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -250,12 +250,6 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun useAlwaysAvailableJSErrorHandling(): Boolean = accessor.useAlwaysAvailableJSErrorHandling()
|
||||
|
||||
/**
|
||||
* If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun useEditTextStockAndroidFocusBehavior(): Boolean = accessor.useEditTextStockAndroidFocusBehavior()
|
||||
|
||||
/**
|
||||
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
|
||||
*/
|
||||
|
||||
+1
-11
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<0496ecf3d1e5d8a2e6d4d594aca806d0>>
|
||||
* @generated SignedSource<<9ecb711480b7d6c22bac380c28d035bc>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
|
||||
private var useFabricInteropCache: Boolean? = null
|
||||
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
||||
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
||||
@@ -399,15 +398,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useEditTextStockAndroidFocusBehavior(): Boolean {
|
||||
var cached = useEditTextStockAndroidFocusBehaviorCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.useEditTextStockAndroidFocusBehavior()
|
||||
useEditTextStockAndroidFocusBehaviorCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useFabricInterop(): Boolean {
|
||||
var cached = useFabricInteropCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<c4f3b0cee8b9b4b9cebb589801e1dd15>>
|
||||
* @generated SignedSource<<2151e5ec5d04924e742f37b527dc23b9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -102,8 +102,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useEditTextStockAndroidFocusBehavior(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<a8900217ae0385947b619c8fa0834942>>
|
||||
* @generated SignedSource<<56f86a3a0c0bbf453cf45a0db541ef54>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -97,8 +97,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
|
||||
|
||||
override fun useEditTextStockAndroidFocusBehavior(): Boolean = true
|
||||
|
||||
override fun useFabricInterop(): Boolean = false
|
||||
|
||||
override fun useNativeViewConfigsInBridgelessMode(): Boolean = false
|
||||
|
||||
+1
-12
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<8f5180a0ef154c083ac38d28e650ee11>>
|
||||
* @generated SignedSource<<5b016fd6298477856116736e37c37c6f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
|
||||
private var useFabricInteropCache: Boolean? = null
|
||||
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
||||
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
||||
@@ -440,16 +439,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useEditTextStockAndroidFocusBehavior(): Boolean {
|
||||
var cached = useEditTextStockAndroidFocusBehaviorCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.useEditTextStockAndroidFocusBehavior()
|
||||
accessedFeatureFlags.add("useEditTextStockAndroidFocusBehavior")
|
||||
useEditTextStockAndroidFocusBehaviorCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useFabricInterop(): Boolean {
|
||||
var cached = useFabricInteropCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<33571f99b1f78fbc62cecfca5f8351fa>>
|
||||
* @generated SignedSource<<b4d6157922f6182dd588d5ae5b54ead9>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -97,8 +97,6 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean
|
||||
|
||||
@DoNotStrip public fun useEditTextStockAndroidFocusBehavior(): Boolean
|
||||
|
||||
@DoNotStrip public fun useFabricInterop(): Boolean
|
||||
|
||||
@DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
|
||||
|
||||
+19
-36
@@ -36,6 +36,7 @@ import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
@@ -146,9 +147,6 @@ public class ReactEditText extends AppCompatEditText {
|
||||
|
||||
public ReactEditText(Context context) {
|
||||
super(context);
|
||||
if (!ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
|
||||
setFocusableInTouchMode(false);
|
||||
}
|
||||
|
||||
mInputMethodManager =
|
||||
(InputMethodManager)
|
||||
@@ -191,9 +189,7 @@ public class ReactEditText extends AppCompatEditText {
|
||||
// selection on accessibility click to undo that.
|
||||
setSelection(length);
|
||||
}
|
||||
return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
|
||||
? requestFocusProgramatically()
|
||||
: requestFocusInternal();
|
||||
return requestFocusProgramatically();
|
||||
}
|
||||
return super.performAccessibilityAction(host, action, args);
|
||||
}
|
||||
@@ -341,29 +337,28 @@ public class ReactEditText extends AppCompatEditText {
|
||||
return super.onTextContextMenuItem(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFocus() {
|
||||
boolean useStockFocusBehavior = ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior();
|
||||
if (!useStockFocusBehavior) {
|
||||
setFocusableInTouchMode(false);
|
||||
public void clearFocusAndMaybeRefocus() {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P || !isInTouchMode()) {
|
||||
super.clearFocus();
|
||||
} else {
|
||||
// Avoid refocusing to a new view on old versions of Android by default
|
||||
// by preventing `requestFocus()` on the rootView from moving focus to any child.
|
||||
// https://cs.android.com/android/_/android/platform/frameworks/base/+/bdc66cb5a0ef513f4306edf9156cc978b08e06e4
|
||||
ViewGroup rootViewGroup = (ViewGroup)getRootView();
|
||||
int oldDescendantFocusability = rootViewGroup.getDescendantFocusability();
|
||||
rootViewGroup.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
|
||||
super.clearFocus();
|
||||
rootViewGroup.setDescendantFocusability(oldDescendantFocusability);
|
||||
}
|
||||
super.clearFocus();
|
||||
|
||||
hideSoftKeyboard();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
|
||||
// This is a no-op so that when the OS calls requestFocus(), nothing will happen. ReactEditText
|
||||
// is a controlled component, which means its focus is controlled by JS, with two exceptions:
|
||||
// autofocus when it's attached to the window, and responding to accessibility events. In both
|
||||
// of these cases, we call requestFocusInternal() directly.
|
||||
return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
|
||||
? super.requestFocus(direction, previouslyFocusedRect)
|
||||
: isFocused();
|
||||
/* package */ void clearFocusFromJS() {
|
||||
clearFocusAndMaybeRefocus();
|
||||
}
|
||||
|
||||
private boolean requestFocusInternal() {
|
||||
setFocusableInTouchMode(true);
|
||||
// We must explicitly call this method on the super class; if we call requestFocus() without
|
||||
// any arguments, it will call into the overridden requestFocus(int, Rect) above, which no-ops.
|
||||
boolean focused = super.requestFocus(View.FOCUS_DOWN, null);
|
||||
@@ -656,15 +651,7 @@ public class ReactEditText extends AppCompatEditText {
|
||||
|
||||
// VisibleForTesting from {@link TextInputEventsTestCase}.
|
||||
public void requestFocusFromJS() {
|
||||
if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
|
||||
requestFocusProgramatically();
|
||||
} else {
|
||||
requestFocusInternal();
|
||||
}
|
||||
}
|
||||
|
||||
/* package */ void clearFocusFromJS() {
|
||||
clearFocus();
|
||||
requestFocusProgramatically();
|
||||
}
|
||||
|
||||
// VisibleForTesting from {@link TextInputEventsTestCase}.
|
||||
@@ -1107,11 +1094,7 @@ public class ReactEditText extends AppCompatEditText {
|
||||
}
|
||||
|
||||
if (mAutoFocus && !mDidAttachToWindow) {
|
||||
if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
|
||||
requestFocusProgramatically();
|
||||
} else {
|
||||
requestFocusInternal();
|
||||
}
|
||||
requestFocusProgramatically();
|
||||
}
|
||||
|
||||
mDidAttachToWindow = true;
|
||||
|
||||
+1
-1
@@ -1164,7 +1164,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
}
|
||||
|
||||
if (shouldBlur) {
|
||||
editText.clearFocus();
|
||||
editText.clearFocusAndMaybeRefocus();
|
||||
}
|
||||
|
||||
// Prevent default behavior except when we want it to insert a newline.
|
||||
|
||||
+1
-15
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<83b23039ed9fff5109ff3b532648baac>>
|
||||
* @generated SignedSource<<cf0734c38bab916ecaf361bc557b8802>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -261,12 +261,6 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useEditTextStockAndroidFocusBehavior() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useEditTextStockAndroidFocusBehavior");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useFabricInterop() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useFabricInterop");
|
||||
@@ -498,11 +492,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling(
|
||||
return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useEditTextStockAndroidFocusBehavior(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useFabricInterop(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useFabricInterop();
|
||||
@@ -680,9 +669,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"useAlwaysAvailableJSErrorHandling",
|
||||
JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling),
|
||||
makeNativeMethod(
|
||||
"useEditTextStockAndroidFocusBehavior",
|
||||
JReactNativeFeatureFlagsCxxInterop::useEditTextStockAndroidFocusBehavior),
|
||||
makeNativeMethod(
|
||||
"useFabricInterop",
|
||||
JReactNativeFeatureFlagsCxxInterop::useFabricInterop),
|
||||
|
||||
+1
-4
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<efb0288fd19fb35e4582522c835301b4>>
|
||||
* @generated SignedSource<<f295d109e9a81ce2d2040a5fc89e9ada>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -141,9 +141,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool useAlwaysAvailableJSErrorHandling(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useEditTextStockAndroidFocusBehavior(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useFabricInterop(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<661a4193f9ba7af0c963bc13751deb15>>
|
||||
* @generated SignedSource<<1c90106ded5dc5f08cdec4dede695341>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -174,10 +174,6 @@ bool ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() {
|
||||
return getAccessor().useAlwaysAvailableJSErrorHandling();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior() {
|
||||
return getAccessor().useEditTextStockAndroidFocusBehavior();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useFabricInterop() {
|
||||
return getAccessor().useFabricInterop();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<53e965423f2957b37e0470c607cc45a4>>
|
||||
* @generated SignedSource<<ce2f5895234f1cfb30374c72db54ccce>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -224,11 +224,6 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool useAlwaysAvailableJSErrorHandling();
|
||||
|
||||
/**
|
||||
* If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
|
||||
*/
|
||||
RN_EXPORT static bool useEditTextStockAndroidFocusBehavior();
|
||||
|
||||
/**
|
||||
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
|
||||
*/
|
||||
|
||||
+8
-26
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<5ff3ac57eb17d9b6642d98f2fc35bd9d>>
|
||||
* @generated SignedSource<<f975f6ffd2d6ec5d9057585ac0613c23>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -695,24 +695,6 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useEditTextStockAndroidFocusBehavior() {
|
||||
auto flagValue = useEditTextStockAndroidFocusBehavior_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(37, "useEditTextStockAndroidFocusBehavior");
|
||||
|
||||
flagValue = currentProvider_->useEditTextStockAndroidFocusBehavior();
|
||||
useEditTextStockAndroidFocusBehavior_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
|
||||
auto flagValue = useFabricInterop_.load();
|
||||
|
||||
@@ -722,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(38, "useFabricInterop");
|
||||
markFlagAsAccessed(37, "useFabricInterop");
|
||||
|
||||
flagValue = currentProvider_->useFabricInterop();
|
||||
useFabricInterop_ = flagValue;
|
||||
@@ -740,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(39, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(38, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -758,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(40, "useOptimizedEventBatchingOnAndroid");
|
||||
markFlagAsAccessed(39, "useOptimizedEventBatchingOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
|
||||
useOptimizedEventBatchingOnAndroid_ = flagValue;
|
||||
@@ -776,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(41, "useRawPropsJsiValue");
|
||||
markFlagAsAccessed(40, "useRawPropsJsiValue");
|
||||
|
||||
flagValue = currentProvider_->useRawPropsJsiValue();
|
||||
useRawPropsJsiValue_ = flagValue;
|
||||
@@ -794,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(42, "useShadowNodeStateOnClone");
|
||||
markFlagAsAccessed(41, "useShadowNodeStateOnClone");
|
||||
|
||||
flagValue = currentProvider_->useShadowNodeStateOnClone();
|
||||
useShadowNodeStateOnClone_ = flagValue;
|
||||
@@ -812,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(43, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(42, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -830,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(44, "useTurboModules");
|
||||
markFlagAsAccessed(43, "useTurboModules");
|
||||
|
||||
flagValue = currentProvider_->useTurboModules();
|
||||
useTurboModules_ = flagValue;
|
||||
|
||||
+2
-4
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<267385c8df88a5d1eb7f1e2478209d39>>
|
||||
* @generated SignedSource<<978f828e7368b8802f8eaa5194e86e2f>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool traceTurboModulePromiseRejectionsOnAndroid();
|
||||
bool updateRuntimeShadowNodeReferencesOnCommit();
|
||||
bool useAlwaysAvailableJSErrorHandling();
|
||||
bool useEditTextStockAndroidFocusBehavior();
|
||||
bool useFabricInterop();
|
||||
bool useNativeViewConfigsInBridgelessMode();
|
||||
bool useOptimizedEventBatchingOnAndroid();
|
||||
@@ -88,7 +87,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 45> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 44> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> disableMountItemReorderingAndroid_;
|
||||
@@ -127,7 +126,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> traceTurboModulePromiseRejectionsOnAndroid_;
|
||||
std::atomic<std::optional<bool>> updateRuntimeShadowNodeReferencesOnCommit_;
|
||||
std::atomic<std::optional<bool>> useAlwaysAvailableJSErrorHandling_;
|
||||
std::atomic<std::optional<bool>> useEditTextStockAndroidFocusBehavior_;
|
||||
std::atomic<std::optional<bool>> useFabricInterop_;
|
||||
std::atomic<std::optional<bool>> useNativeViewConfigsInBridgelessMode_;
|
||||
std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<48bb4ea50c42676aee161ea1594a6aec>>
|
||||
* @generated SignedSource<<643c1fd24fbc1a77ef109e712023f9d5>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -175,10 +175,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool useEditTextStockAndroidFocusBehavior() override {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool useFabricInterop() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-10
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<e92353bf22b82344bc6ab97f08ca724c>>
|
||||
* @generated SignedSource<<a0aeb1ef5255e98ab3df8e892a6147f4>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -378,15 +378,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
||||
return ReactNativeFeatureFlagsDefaults::useAlwaysAvailableJSErrorHandling();
|
||||
}
|
||||
|
||||
bool useEditTextStockAndroidFocusBehavior() override {
|
||||
auto value = values_["useEditTextStockAndroidFocusBehavior"];
|
||||
if (!value.isNull()) {
|
||||
return value.getBool();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::useEditTextStockAndroidFocusBehavior();
|
||||
}
|
||||
|
||||
bool useFabricInterop() override {
|
||||
auto value = values_["useFabricInterop"];
|
||||
if (!value.isNull()) {
|
||||
|
||||
+1
-2
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<d8f7773c6f24c715a6c0e0ab703677fd>>
|
||||
* @generated SignedSource<<4db2ff36701f0dbcd3dd59fa5879a612>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,6 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool traceTurboModulePromiseRejectionsOnAndroid() = 0;
|
||||
virtual bool updateRuntimeShadowNodeReferencesOnCommit() = 0;
|
||||
virtual bool useAlwaysAvailableJSErrorHandling() = 0;
|
||||
virtual bool useEditTextStockAndroidFocusBehavior() = 0;
|
||||
virtual bool useFabricInterop() = 0;
|
||||
virtual bool useNativeViewConfigsInBridgelessMode() = 0;
|
||||
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
|
||||
|
||||
+1
-6
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<76f1f689940817c1df6ace2f8dd062e7>>
|
||||
* @generated SignedSource<<4f6ee8b8bae8ea84fab77eb9feb63f9d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -229,11 +229,6 @@ bool NativeReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling(
|
||||
return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::useFabricInterop(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::useFabricInterop();
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<af8c15575ff94feff9dadaaf8becdf18>>
|
||||
* @generated SignedSource<<0009cf8a05d254e3695e7ce57fc5f8af>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -111,8 +111,6 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool useAlwaysAvailableJSErrorHandling(jsi::Runtime& runtime);
|
||||
|
||||
bool useEditTextStockAndroidFocusBehavior(jsi::Runtime& runtime);
|
||||
|
||||
bool useFabricInterop(jsi::Runtime& runtime);
|
||||
|
||||
bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime);
|
||||
|
||||
@@ -440,16 +440,6 @@ const definitions: FeatureFlagDefinitions = {
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
useEditTextStockAndroidFocusBehavior: {
|
||||
defaultValue: true,
|
||||
metadata: {
|
||||
description:
|
||||
'If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.',
|
||||
expectedReleaseValue: true,
|
||||
purpose: 'release',
|
||||
},
|
||||
ossReleaseStage: 'none',
|
||||
},
|
||||
useFabricInterop: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<5b1d3ba6712de7a927eeeb8602ee2a8f>>
|
||||
* @generated SignedSource<<a28a3b729eaeee7ba3b1c2105d277286>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -86,7 +86,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
|
||||
traceTurboModulePromiseRejectionsOnAndroid: Getter<boolean>,
|
||||
updateRuntimeShadowNodeReferencesOnCommit: Getter<boolean>,
|
||||
useAlwaysAvailableJSErrorHandling: Getter<boolean>,
|
||||
useEditTextStockAndroidFocusBehavior: Getter<boolean>,
|
||||
useFabricInterop: Getter<boolean>,
|
||||
useNativeViewConfigsInBridgelessMode: Getter<boolean>,
|
||||
useOptimizedEventBatchingOnAndroid: Getter<boolean>,
|
||||
@@ -323,10 +322,6 @@ export const updateRuntimeShadowNodeReferencesOnCommit: Getter<boolean> = create
|
||||
* In Bridgeless mode, use the always available javascript error reporting pipeline.
|
||||
*/
|
||||
export const useAlwaysAvailableJSErrorHandling: Getter<boolean> = createNativeFlagGetter('useAlwaysAvailableJSErrorHandling', false);
|
||||
/**
|
||||
* If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
|
||||
*/
|
||||
export const useEditTextStockAndroidFocusBehavior: Getter<boolean> = createNativeFlagGetter('useEditTextStockAndroidFocusBehavior', true);
|
||||
/**
|
||||
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
|
||||
*/
|
||||
|
||||
+1
-2
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<f8da5261357616749d6319190ed0139d>>
|
||||
* @generated SignedSource<<2499cbe243c048d9e3647342ebec3544>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,6 @@ export interface Spec extends TurboModule {
|
||||
+traceTurboModulePromiseRejectionsOnAndroid?: () => boolean;
|
||||
+updateRuntimeShadowNodeReferencesOnCommit?: () => boolean;
|
||||
+useAlwaysAvailableJSErrorHandling?: () => boolean;
|
||||
+useEditTextStockAndroidFocusBehavior?: () => boolean;
|
||||
+useFabricInterop?: () => boolean;
|
||||
+useNativeViewConfigsInBridgelessMode?: () => boolean;
|
||||
+useOptimizedEventBatchingOnAndroid?: () => boolean;
|
||||
|
||||
Reference in new issue
Block a user