react-native 0.79.2 → 0.79.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -4
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/React/Base/RCTVersion.m +1 -1
  4. package/React/CoreModules/RCTDeviceInfo.mm +50 -20
  5. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +0 -6
  6. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +0 -9
  7. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +18 -4
  8. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +1 -1
  9. package/ReactAndroid/gradle.properties +1 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
  11. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
  12. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
  13. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
  14. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
  15. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +0 -2
  16. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
  17. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  18. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +2 -2
  19. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +19 -36
  20. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +1 -1
  21. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +0 -3
  22. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
  23. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
  24. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  25. package/ReactCommon/jsc/React-jsc.podspec +1 -1
  26. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
  28. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +8 -26
  29. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
  30. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
  31. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +1 -10
  32. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
  33. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
  34. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
  35. package/ReactCommon/react/runtime/TimerManager.cpp +6 -4
  36. package/ReactCommon/react/runtime/TimerManager.h +3 -1
  37. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +0 -1
  38. package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +9 -5
  39. package/package.json +9 -8
  40. package/scripts/codegen/generate-artifacts-executor.js +55 -18
  41. package/sdks/.hermesversion +1 -1
  42. package/sdks/hermesc/osx-bin/hermes +0 -0
  43. package/sdks/hermesc/osx-bin/hermesc +0 -0
  44. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  45. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  46. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  47. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
  48. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
  49. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
  50. package/types/index.d.ts +1 -1
  51. package/types/tsconfig.test.json +16 -0
@@ -314,10 +314,6 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
314
314
  {
315
315
  return true;
316
316
  }
317
- bool updateRuntimeShadowNodeReferencesOnCommit() override
318
- {
319
- return true;
320
- }
321
317
  bool useShadowNodeStateOnClone() override
322
318
  {
323
319
  return true;
@@ -16,6 +16,6 @@ export const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 79,
19
- patch: 2,
19
+ patch: 4,
20
20
  prerelease: null,
21
21
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(79),
26
- RCTVersionPatch: @(2),
26
+ RCTVersionPatch: @(4),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -14,9 +14,7 @@
14
14
  #import <React/RCTEventDispatcherProtocol.h>
15
15
  #import <React/RCTInitializing.h>
16
16
  #import <React/RCTInvalidating.h>
17
- #import <React/RCTKeyWindowValuesProxy.h>
18
17
  #import <React/RCTUtils.h>
19
- #import <React/RCTWindowSafeAreaProxy.h>
20
18
  #import <atomic>
21
19
 
22
20
  #import "CoreModulesPlugins.h"
@@ -31,8 +29,13 @@ using namespace facebook::react;
31
29
  NSDictionary *_currentInterfaceDimensions;
32
30
  BOOL _isFullscreen;
33
31
  std::atomic<BOOL> _invalidated;
32
+ NSDictionary *_constants;
33
+
34
+ __weak UIWindow *_applicationWindow;
34
35
  }
35
36
 
37
+ static NSString *const kFrameKeyPath = @"frame";
38
+
36
39
  @synthesize moduleRegistry = _moduleRegistry;
37
40
 
38
41
  RCT_EXPORT_MODULE()
@@ -40,14 +43,26 @@ RCT_EXPORT_MODULE()
40
43
  - (instancetype)init
41
44
  {
42
45
  if (self = [super init]) {
43
- [[RCTKeyWindowValuesProxy sharedInstance] startObservingWindowSizeIfNecessary];
46
+ _applicationWindow = RCTKeyWindow();
47
+ [_applicationWindow addObserver:self forKeyPath:kFrameKeyPath options:NSKeyValueObservingOptionNew context:nil];
44
48
  }
45
49
  return self;
46
50
  }
47
51
 
52
+ - (void)observeValueForKeyPath:(NSString *)keyPath
53
+ ofObject:(id)object
54
+ change:(NSDictionary *)change
55
+ context:(void *)context
56
+ {
57
+ if ([keyPath isEqualToString:kFrameKeyPath]) {
58
+ [self interfaceFrameDidChange];
59
+ [[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
60
+ }
61
+ }
62
+
48
63
  + (BOOL)requiresMainQueueSetup
49
64
  {
50
- return NO;
65
+ return YES;
51
66
  }
52
67
 
53
68
  - (dispatch_queue_t)methodQueue
@@ -81,7 +96,7 @@ RCT_EXPORT_MODULE()
81
96
 
82
97
  #if TARGET_OS_IOS
83
98
 
84
- _currentInterfaceOrientation = [RCTKeyWindowValuesProxy sharedInstance].currentInterfaceOrientation;
99
+ _currentInterfaceOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
85
100
 
86
101
  [[NSNotificationCenter defaultCenter] addObserver:self
87
102
  selector:@selector(interfaceFrameDidChange)
@@ -98,6 +113,15 @@ RCT_EXPORT_MODULE()
98
113
  selector:@selector(invalidate)
99
114
  name:RCTBridgeWillInvalidateModulesNotification
100
115
  object:nil];
116
+
117
+ _constants = @{
118
+ @"Dimensions" : [self _exportedDimensions],
119
+ // Note:
120
+ // This prop is deprecated and will be removed in a future release.
121
+ // Please use this only for a quick and temporary solution.
122
+ // Use <SafeAreaView> instead.
123
+ @"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
124
+ };
101
125
  }
102
126
 
103
127
  - (void)invalidate
@@ -120,6 +144,8 @@ RCT_EXPORT_MODULE()
120
144
 
121
145
  [[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];
122
146
 
147
+ [_applicationWindow removeObserver:self forKeyPath:kFrameKeyPath];
148
+
123
149
  #if TARGET_OS_IOS
124
150
  [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
125
151
  #endif
@@ -132,8 +158,13 @@ static BOOL RCTIsIPhoneNotched()
132
158
 
133
159
  #if TARGET_OS_IOS
134
160
  dispatch_once(&onceToken, ^{
161
+ RCTAssertMainQueue();
162
+
135
163
  // 20pt is the top safeArea value in non-notched devices
136
- isIPhoneNotched = [RCTWindowSafeAreaProxy sharedInstance].currentSafeAreaInsets.top > 20;
164
+ UIWindow *keyWindow = RCTKeyWindow();
165
+ if (keyWindow) {
166
+ isIPhoneNotched = keyWindow.safeAreaInsets.top > 20;
167
+ }
137
168
  });
138
169
  #endif
139
170
 
@@ -142,11 +173,13 @@ static BOOL RCTIsIPhoneNotched()
142
173
 
143
174
  static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
144
175
  {
176
+ RCTAssertMainQueue();
145
177
  UIScreen *mainScreen = UIScreen.mainScreen;
146
178
  CGSize screenSize = mainScreen.bounds.size;
179
+ UIView *mainWindow = RCTKeyWindow();
147
180
 
148
181
  // We fallback to screen size if a key window is not found.
149
- CGSize windowSize = [RCTKeyWindowValuesProxy sharedInstance].windowSize;
182
+ CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize;
150
183
 
151
184
  NSDictionary<NSString *, NSNumber *> *dimsWindow = @{
152
185
  @"width" : @(windowSize.width),
@@ -170,7 +203,10 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
170
203
  RCTAssert(_moduleRegistry, @"Failed to get exported dimensions: RCTModuleRegistry is nil");
171
204
  RCTAccessibilityManager *accessibilityManager =
172
205
  (RCTAccessibilityManager *)[_moduleRegistry moduleForName:"AccessibilityManager"];
173
- RCTAssert(accessibilityManager, @"Failed to get exported dimensions: AccessibilityManager is nil");
206
+ // TOOD(T225745315): For some reason, accessibilityManager is nil in some cases.
207
+ // We default the fontScale to 1.0 in this case. This should be okay: if we assume
208
+ // that accessibilityManager will eventually become available, js will eventually
209
+ // be updated with the correct fontScale.
174
210
  CGFloat fontScale = accessibilityManager ? accessibilityManager.multiplier : 1.0;
175
211
  return RCTExportedDimensions(fontScale);
176
212
  }
@@ -182,14 +218,7 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
182
218
 
183
219
  - (NSDictionary<NSString *, id> *)getConstants
184
220
  {
185
- return @{
186
- @"Dimensions" : [self _exportedDimensions],
187
- // Note:
188
- // This prop is deprecated and will be removed in a future release.
189
- // Please use this only for a quick and temporary solution.
190
- // Use <SafeAreaView> instead.
191
- @"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
192
- };
221
+ return _constants;
193
222
  }
194
223
 
195
224
  - (void)didReceiveNewContentSizeMultiplier
@@ -209,10 +238,11 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
209
238
  - (void)interfaceOrientationDidChange
210
239
  {
211
240
  #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
212
- UIWindow *keyWindow = RCTKeyWindow();
213
- UIInterfaceOrientation nextOrientation = keyWindow.windowScene.interfaceOrientation;
241
+ UIApplication *application = RCTSharedApplication();
242
+ UIInterfaceOrientation nextOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
214
243
 
215
- BOOL isRunningInFullScreen = CGRectEqualToRect(keyWindow.frame, keyWindow.screen.bounds);
244
+ BOOL isRunningInFullScreen =
245
+ CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);
216
246
  // We are catching here two situations for multitasking view:
217
247
  // a) The app is in Split View and the container gets resized -> !isRunningInFullScreen
218
248
  // b) The app changes to/from fullscreen example: App runs in slide over mode and goes into fullscreen->
@@ -275,4 +305,4 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
275
305
  Class RCTDeviceInfoCls(void)
276
306
  {
277
307
  return RCTDeviceInfo.class;
278
- }
308
+ }
@@ -201,11 +201,6 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwa
201
201
  rt
202
202
  );
203
203
  }
204
- static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
205
- return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useEditTextStockAndroidFocusBehavior(
206
- rt
207
- );
208
- }
209
204
  static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
210
205
  return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useFabricInterop(
211
206
  rt
@@ -282,7 +277,6 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI
282
277
  methodMap_["traceTurboModulePromiseRejectionsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid};
283
278
  methodMap_["updateRuntimeShadowNodeReferencesOnCommit"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit};
284
279
  methodMap_["useAlwaysAvailableJSErrorHandling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling};
285
- methodMap_["useEditTextStockAndroidFocusBehavior"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useEditTextStockAndroidFocusBehavior};
286
280
  methodMap_["useFabricInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop};
287
281
  methodMap_["useNativeViewConfigsInBridgelessMode"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode};
288
282
  methodMap_["useOptimizedEventBatchingOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid};
@@ -58,7 +58,6 @@ public:
58
58
  virtual bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) = 0;
59
59
  virtual bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) = 0;
60
60
  virtual bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) = 0;
61
- virtual bool useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt) = 0;
62
61
  virtual bool useFabricInterop(jsi::Runtime &rt) = 0;
63
62
  virtual bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) = 0;
64
63
  virtual bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) = 0;
@@ -400,14 +399,6 @@ private:
400
399
  return bridging::callFromJs<bool>(
401
400
  rt, &T::useAlwaysAvailableJSErrorHandling, jsInvoker_, instance_);
402
401
  }
403
- bool useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt) override {
404
- static_assert(
405
- bridging::getParameterCount(&T::useEditTextStockAndroidFocusBehavior) == 1,
406
- "Expected useEditTextStockAndroidFocusBehavior(...) to have 1 parameters");
407
-
408
- return bridging::callFromJs<bool>(
409
- rt, &T::useEditTextStockAndroidFocusBehavior, jsInvoker_, instance_);
410
- }
411
402
  bool useFabricInterop(jsi::Runtime &rt) override {
412
403
  static_assert(
413
404
  bridging::getParameterCount(&T::useFabricInterop) == 1,
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
170
170
 
171
171
  - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
172
172
  {
173
- [_viewsToBeMounted addObject:@{
174
- kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
175
- kRCTLegacyInteropChildComponentKey : childComponentView
176
- }];
173
+ if (_adapter && index == _adapter.paperView.reactSubviews.count) {
174
+ // This is a new child view that is being added to the end of the children array.
175
+ // After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
176
+ // Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
177
+ // called and the `finalizeUpdate` is not invoked.
178
+ if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
179
+ UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
180
+ [_adapter.paperView insertReactSubview:target atIndex:index];
181
+ } else {
182
+ [_adapter.paperView insertReactSubview:childComponentView atIndex:index];
183
+ }
184
+ [_adapter.paperView didUpdateReactSubviews];
185
+ } else {
186
+ [_viewsToBeMounted addObject:@{
187
+ kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
188
+ kRCTLegacyInteropChildComponentKey : childComponentView
189
+ }];
190
+ }
177
191
  }
178
192
 
179
193
  - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
@@ -60,7 +60,7 @@ using namespace facebook::react;
60
60
  const auto &newSwitchProps = static_cast<const SwitchProps &>(*props);
61
61
 
62
62
  // `value`
63
- if (oldSwitchProps.value != newSwitchProps.value) {
63
+ if (!_isInitialValueSet || oldSwitchProps.value != newSwitchProps.value) {
64
64
  BOOL shouldAnimate = _isInitialValueSet == YES;
65
65
  [_switchView setOn:newSwitchProps.value animated:shouldAnimate];
66
66
  }
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.79.2
1
+ VERSION_NAME=0.79.4
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<b263bdcbc1258f7d5c56e69732ba9076>>
7
+ * @generated SignedSource<<fa641112b3a8888ba2b24cf8829e9382>>
8
8
  */
9
9
 
10
10
  /**
@@ -250,12 +250,6 @@ public object ReactNativeFeatureFlags {
250
250
  @JvmStatic
251
251
  public fun useAlwaysAvailableJSErrorHandling(): Boolean = accessor.useAlwaysAvailableJSErrorHandling()
252
252
 
253
- /**
254
- * If true, focusing in ReactEditText will mainly use stock Android requestFocus() behavior. If false it will use legacy custom focus behavior.
255
- */
256
- @JvmStatic
257
- public fun useEditTextStockAndroidFocusBehavior(): Boolean = accessor.useEditTextStockAndroidFocusBehavior()
258
-
259
253
  /**
260
254
  * 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.
261
255
  */
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<0496ecf3d1e5d8a2e6d4d594aca806d0>>
7
+ * @generated SignedSource<<9ecb711480b7d6c22bac380c28d035bc>>
8
8
  */
9
9
 
10
10
  /**
@@ -57,7 +57,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
57
57
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
58
58
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
59
59
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
60
- private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
61
60
  private var useFabricInteropCache: Boolean? = null
62
61
  private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
63
62
  private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
@@ -399,15 +398,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
399
398
  return cached
400
399
  }
401
400
 
402
- override fun useEditTextStockAndroidFocusBehavior(): Boolean {
403
- var cached = useEditTextStockAndroidFocusBehaviorCache
404
- if (cached == null) {
405
- cached = ReactNativeFeatureFlagsCxxInterop.useEditTextStockAndroidFocusBehavior()
406
- useEditTextStockAndroidFocusBehaviorCache = cached
407
- }
408
- return cached
409
- }
410
-
411
401
  override fun useFabricInterop(): Boolean {
412
402
  var cached = useFabricInteropCache
413
403
  if (cached == null) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<c4f3b0cee8b9b4b9cebb589801e1dd15>>
7
+ * @generated SignedSource<<2151e5ec5d04924e742f37b527dc23b9>>
8
8
  */
9
9
 
10
10
  /**
@@ -102,8 +102,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
102
102
 
103
103
  @DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
104
104
 
105
- @DoNotStrip @JvmStatic public external fun useEditTextStockAndroidFocusBehavior(): Boolean
106
-
107
105
  @DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
108
106
 
109
107
  @DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<a8900217ae0385947b619c8fa0834942>>
7
+ * @generated SignedSource<<56f86a3a0c0bbf453cf45a0db541ef54>>
8
8
  */
9
9
 
10
10
  /**
@@ -97,8 +97,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
97
97
 
98
98
  override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
99
99
 
100
- override fun useEditTextStockAndroidFocusBehavior(): Boolean = true
101
-
102
100
  override fun useFabricInterop(): Boolean = false
103
101
 
104
102
  override fun useNativeViewConfigsInBridgelessMode(): Boolean = false
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<8f5180a0ef154c083ac38d28e650ee11>>
7
+ * @generated SignedSource<<5b016fd6298477856116736e37c37c6f>>
8
8
  */
9
9
 
10
10
  /**
@@ -61,7 +61,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
61
61
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
62
62
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
63
63
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
64
- private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
65
64
  private var useFabricInteropCache: Boolean? = null
66
65
  private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
67
66
  private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
@@ -440,16 +439,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
440
439
  return cached
441
440
  }
442
441
 
443
- override fun useEditTextStockAndroidFocusBehavior(): Boolean {
444
- var cached = useEditTextStockAndroidFocusBehaviorCache
445
- if (cached == null) {
446
- cached = currentProvider.useEditTextStockAndroidFocusBehavior()
447
- accessedFeatureFlags.add("useEditTextStockAndroidFocusBehavior")
448
- useEditTextStockAndroidFocusBehaviorCache = cached
449
- }
450
- return cached
451
- }
452
-
453
442
  override fun useFabricInterop(): Boolean {
454
443
  var cached = useFabricInteropCache
455
444
  if (cached == null) {
@@ -18,7 +18,5 @@ public class ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android(
18
18
 
19
19
  override fun useTurboModules(): Boolean = bridgelessEnabled || turboModulesEnabled
20
20
 
21
- override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = true
22
-
23
21
  override fun useShadowNodeStateOnClone(): Boolean = true
24
22
  }
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<33571f99b1f78fbc62cecfca5f8351fa>>
7
+ * @generated SignedSource<<b4d6157922f6182dd588d5ae5b54ead9>>
8
8
  */
9
9
 
10
10
  /**
@@ -97,8 +97,6 @@ public interface ReactNativeFeatureFlagsProvider {
97
97
 
98
98
  @DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean
99
99
 
100
- @DoNotStrip public fun useEditTextStockAndroidFocusBehavior(): Boolean
101
-
102
100
  @DoNotStrip public fun useFabricInterop(): Boolean
103
101
 
104
102
  @DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 79,
20
- "patch", 2,
20
+ "patch", 4,
21
21
  "prerelease", null);
22
22
  }
@@ -136,10 +136,10 @@ internal data class BorderRadiusStyle(
136
136
  (startStart ?: topStart ?: topLeft ?: uniform)?.resolve(width, height)
137
137
  ?: zeroRadii,
138
138
  bottomLeft =
139
- (endEnd ?: bottomStart ?: bottomRight ?: uniform)?.resolve(width, height)
139
+ (endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.resolve(width, height)
140
140
  ?: zeroRadii,
141
141
  bottomRight =
142
- (startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.resolve(width, height)
142
+ (startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.resolve(width, height)
143
143
  ?: zeroRadii,
144
144
  width = width,
145
145
  height = height,
@@ -36,6 +36,7 @@ import android.view.Menu;
36
36
  import android.view.MenuItem;
37
37
  import android.view.MotionEvent;
38
38
  import android.view.View;
39
+ import android.view.ViewGroup;
39
40
  import android.view.accessibility.AccessibilityNodeInfo;
40
41
  import android.view.inputmethod.EditorInfo;
41
42
  import android.view.inputmethod.InputConnection;
@@ -146,9 +147,6 @@ public class ReactEditText extends AppCompatEditText {
146
147
 
147
148
  public ReactEditText(Context context) {
148
149
  super(context);
149
- if (!ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
150
- setFocusableInTouchMode(false);
151
- }
152
150
 
153
151
  mInputMethodManager =
154
152
  (InputMethodManager)
@@ -191,9 +189,7 @@ public class ReactEditText extends AppCompatEditText {
191
189
  // selection on accessibility click to undo that.
192
190
  setSelection(length);
193
191
  }
194
- return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
195
- ? requestFocusProgramatically()
196
- : requestFocusInternal();
192
+ return requestFocusProgramatically();
197
193
  }
198
194
  return super.performAccessibilityAction(host, action, args);
199
195
  }
@@ -341,29 +337,28 @@ public class ReactEditText extends AppCompatEditText {
341
337
  return super.onTextContextMenuItem(id);
342
338
  }
343
339
 
344
- @Override
345
- public void clearFocus() {
346
- boolean useStockFocusBehavior = ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior();
347
- if (!useStockFocusBehavior) {
348
- setFocusableInTouchMode(false);
340
+ public void clearFocusAndMaybeRefocus() {
341
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P || !isInTouchMode()) {
342
+ super.clearFocus();
343
+ } else {
344
+ // Avoid refocusing to a new view on old versions of Android by default
345
+ // by preventing `requestFocus()` on the rootView from moving focus to any child.
346
+ // https://cs.android.com/android/_/android/platform/frameworks/base/+/bdc66cb5a0ef513f4306edf9156cc978b08e06e4
347
+ ViewGroup rootViewGroup = (ViewGroup)getRootView();
348
+ int oldDescendantFocusability = rootViewGroup.getDescendantFocusability();
349
+ rootViewGroup.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
350
+ super.clearFocus();
351
+ rootViewGroup.setDescendantFocusability(oldDescendantFocusability);
349
352
  }
350
- super.clearFocus();
353
+
351
354
  hideSoftKeyboard();
352
355
  }
353
356
 
354
- @Override
355
- public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
356
- // This is a no-op so that when the OS calls requestFocus(), nothing will happen. ReactEditText
357
- // is a controlled component, which means its focus is controlled by JS, with two exceptions:
358
- // autofocus when it's attached to the window, and responding to accessibility events. In both
359
- // of these cases, we call requestFocusInternal() directly.
360
- return ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()
361
- ? super.requestFocus(direction, previouslyFocusedRect)
362
- : isFocused();
357
+ /* package */ void clearFocusFromJS() {
358
+ clearFocusAndMaybeRefocus();
363
359
  }
364
360
 
365
361
  private boolean requestFocusInternal() {
366
- setFocusableInTouchMode(true);
367
362
  // We must explicitly call this method on the super class; if we call requestFocus() without
368
363
  // any arguments, it will call into the overridden requestFocus(int, Rect) above, which no-ops.
369
364
  boolean focused = super.requestFocus(View.FOCUS_DOWN, null);
@@ -656,15 +651,7 @@ public class ReactEditText extends AppCompatEditText {
656
651
 
657
652
  // VisibleForTesting from {@link TextInputEventsTestCase}.
658
653
  public void requestFocusFromJS() {
659
- if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
660
- requestFocusProgramatically();
661
- } else {
662
- requestFocusInternal();
663
- }
664
- }
665
-
666
- /* package */ void clearFocusFromJS() {
667
- clearFocus();
654
+ requestFocusProgramatically();
668
655
  }
669
656
 
670
657
  // VisibleForTesting from {@link TextInputEventsTestCase}.
@@ -1107,11 +1094,7 @@ public class ReactEditText extends AppCompatEditText {
1107
1094
  }
1108
1095
 
1109
1096
  if (mAutoFocus && !mDidAttachToWindow) {
1110
- if (ReactNativeFeatureFlags.useEditTextStockAndroidFocusBehavior()) {
1111
- requestFocusProgramatically();
1112
- } else {
1113
- requestFocusInternal();
1114
- }
1097
+ requestFocusProgramatically();
1115
1098
  }
1116
1099
 
1117
1100
  mDidAttachToWindow = true;
@@ -1164,7 +1164,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
1164
1164
  }
1165
1165
 
1166
1166
  if (shouldBlur) {
1167
- editText.clearFocus();
1167
+ editText.clearFocusAndMaybeRefocus();
1168
1168
  }
1169
1169
 
1170
1170
  // Prevent default behavior except when we want it to insert a newline.
@@ -588,9 +588,6 @@ public class ReactViewGroup extends ViewGroup
588
588
  UiThreadUtil.assertOnUiThread();
589
589
  checkViewClippingTag(child, Boolean.TRUE);
590
590
  if (!customDrawOrderDisabled()) {
591
- if (indexOfChild(child) == -1) {
592
- return;
593
- }
594
591
  getDrawingOrderHelper().handleRemoveView(child);
595
592
  setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
596
593
  } else {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<83b23039ed9fff5109ff3b532648baac>>
7
+ * @generated SignedSource<<cf0734c38bab916ecaf361bc557b8802>>
8
8
  */
9
9
 
10
10
  /**
@@ -261,12 +261,6 @@ class ReactNativeFeatureFlagsProviderHolder
261
261
  return method(javaProvider_);
262
262
  }
263
263
 
264
- bool useEditTextStockAndroidFocusBehavior() override {
265
- static const auto method =
266
- getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useEditTextStockAndroidFocusBehavior");
267
- return method(javaProvider_);
268
- }
269
-
270
264
  bool useFabricInterop() override {
271
265
  static const auto method =
272
266
  getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useFabricInterop");
@@ -498,11 +492,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling(
498
492
  return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
499
493
  }
500
494
 
501
- bool JReactNativeFeatureFlagsCxxInterop::useEditTextStockAndroidFocusBehavior(
502
- facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
503
- return ReactNativeFeatureFlags::useEditTextStockAndroidFocusBehavior();
504
- }
505
-
506
495
  bool JReactNativeFeatureFlagsCxxInterop::useFabricInterop(
507
496
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
508
497
  return ReactNativeFeatureFlags::useFabricInterop();
@@ -680,9 +669,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
680
669
  makeNativeMethod(
681
670
  "useAlwaysAvailableJSErrorHandling",
682
671
  JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling),
683
- makeNativeMethod(
684
- "useEditTextStockAndroidFocusBehavior",
685
- JReactNativeFeatureFlagsCxxInterop::useEditTextStockAndroidFocusBehavior),
686
672
  makeNativeMethod(
687
673
  "useFabricInterop",
688
674
  JReactNativeFeatureFlagsCxxInterop::useFabricInterop),
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<efb0288fd19fb35e4582522c835301b4>>
7
+ * @generated SignedSource<<f295d109e9a81ce2d2040a5fc89e9ada>>
8
8
  */
9
9
 
10
10
  /**
@@ -141,9 +141,6 @@ class JReactNativeFeatureFlagsCxxInterop
141
141
  static bool useAlwaysAvailableJSErrorHandling(
142
142
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
143
143
 
144
- static bool useEditTextStockAndroidFocusBehavior(
145
- facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
146
-
147
144
  static bool useFabricInterop(
148
145
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
149
146