react-native-macos 0.74.1 → 0.74.3

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.
@@ -16,7 +16,7 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 74,
19
- patch: 1,
19
+ patch: 3,
20
20
  prerelease: null,
21
21
  };
22
22
 
@@ -36,6 +36,9 @@ static const CGFloat kSingleLineKeyboardBottomOffset = 15.0;
36
36
  BOOL _hasInputAccessoryView;
37
37
  // [macOS] remove explicit _predictedText ivar declaration
38
38
  BOOL _didMoveToWindow;
39
+ #if TARGET_OS_OSX // [macOS avoids duplicating effects of textInputDid(Begin|End)Editing calls
40
+ BOOL _isCurrentlyEditing;
41
+ #endif // macOS]
39
42
  }
40
43
 
41
44
  #if !TARGET_OS_OSX // [macOS]
@@ -71,6 +74,9 @@ static const CGFloat kSingleLineKeyboardBottomOffset = 15.0;
71
74
  if (self = [super initWithEventDispatcher:bridge.eventDispatcher]) { // [macOS]
72
75
  _bridge = bridge;
73
76
  _eventDispatcher = bridge.eventDispatcher;
77
+ #if TARGET_OS_OSX // [macOS
78
+ _isCurrentlyEditing = NO;
79
+ #endif // macOS]
74
80
  }
75
81
 
76
82
  return self;
@@ -446,6 +452,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
446
452
 
447
453
  - (void)textInputDidBeginEditing
448
454
  {
455
+ #if TARGET_OS_OSX // [macOS consolidate duplicate callbacks
456
+ if (_isCurrentlyEditing) {
457
+ return;
458
+ }
459
+ _isCurrentlyEditing = YES;
460
+ #endif // macOS]
461
+
449
462
  if (_clearTextOnFocus) {
450
463
  self.backedTextInputView.attributedText = [NSAttributedString new];
451
464
  }
@@ -474,6 +487,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
474
487
 
475
488
  - (void)textInputDidEndEditing
476
489
  {
490
+ #if TARGET_OS_OSX // [macOS consolidate duplicate callbacks
491
+ if (!_isCurrentlyEditing) {
492
+ return;
493
+ }
494
+ _isCurrentlyEditing = NO;
495
+ #endif // macOS]
496
+
477
497
  self.ghostText = nil; // [macOS]
478
498
 
479
499
  [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd
@@ -93,6 +93,9 @@
93
93
  #endif
94
94
  RCTBackedTextFieldDelegateAdapter *_textInputDelegateAdapter;
95
95
  NSDictionary<NSAttributedStringKey, id> *_defaultTextAttributes;
96
+ #if TARGET_OS_OSX // [macOS
97
+ BOOL _isUpdatingPlaceholderText;
98
+ #endif // macOS]
96
99
  }
97
100
 
98
101
  #if TARGET_OS_OSX // [macOS
@@ -116,6 +119,9 @@
116
119
 
117
120
  _textInputDelegateAdapter = [[RCTBackedTextFieldDelegateAdapter alloc] initWithTextField:self];
118
121
  _scrollEnabled = YES;
122
+ #if TARGET_OS_OSX // [macOS
123
+ _isUpdatingPlaceholderText = NO;
124
+ #endif // macOS]
119
125
  }
120
126
 
121
127
  return self;
@@ -361,8 +367,11 @@
361
367
  self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeholder ?: @""
362
368
  attributes:[self _placeholderTextAttributes]];
363
369
  #else // [macOS
370
+ // Set _isUpdatingPlaceholderText to manually suppress RCTUITextFieldDelegate's textFieldEndEditing
371
+ _isUpdatingPlaceholderText = YES;
364
372
  self.placeholderAttributedString = [[NSAttributedString alloc] initWithString:self.placeholder ?: @""
365
373
  attributes:[self _placeholderTextAttributes]];
374
+ _isUpdatingPlaceholderText = NO;
366
375
  #endif // macOS]
367
376
  }
368
377
 
@@ -485,10 +494,17 @@
485
494
  [delegate textFieldDidChange:self];
486
495
  }
487
496
  }
488
-
497
+
489
498
  - (void)textDidEndEditing:(NSNotification *)notification
490
499
  {
491
- [super textDidEndEditing:notification];
500
+ [super textDidEndEditing:notification];
501
+
502
+ // On macOS, setting placeholderAttributedString causes AppKit to call textDidEndEditing.
503
+ // We don't want this to propagate or else we get unexpected onBlur/onEndEditing events.
504
+ if (_isUpdatingPlaceholderText) {
505
+ return;
506
+ }
507
+
492
508
  id<RCTUITextFieldDelegate> delegate = self.delegate;
493
509
  if ([delegate respondsToSelector:@selector(textFieldEndEditing:)]) {
494
510
  [delegate textFieldEndEditing:self];
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(74),
26
- RCTVersionPatch: @(1),
26
+ RCTVersionPatch: @(3),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.74.1
1
+ VERSION_NAME=0.74.3
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -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", 74,
20
- "patch", 1,
20
+ "patch", 3,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 74;
20
- int32_t Patch = 1;
20
+ int32_t Patch = 3;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -14,8 +14,6 @@ target 'HelloWorld-macOS' do
14
14
  :path => '../node_modules/react-native-macos',
15
15
  :hermes_enabled => false,
16
16
  :fabric_enabled => ENV['RCT_NEW_ARCH_ENABLED'] == '1',
17
- # Flipper is not compatible w/ macOS
18
- :flipper_configuration => FlipperConfiguration.disabled,
19
17
  # An absolute path to your application root.
20
18
  :app_path => "#{Pod::Config.instance.installation_root}/.."
21
19
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.74.1",
3
+ "version": "0.74.3",
4
4
  "description": "React Native for macOS",
5
5
  "license": "MIT",
6
6
  "repository": {