react-native-macos 0.81.6 → 0.81.8

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 (57) hide show
  1. package/Libraries/Blob/RCTBlobManager.h +0 -0
  2. package/Libraries/Blob/RCTBlobManager.mm +0 -0
  3. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -0
  4. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  5. package/Libraries/Components/View/ViewPropTypes.js +2 -0
  6. package/Libraries/Core/ReactNativeVersion.js +1 -1
  7. package/Libraries/NativeComponent/BaseViewConfig.ios.js +8 -0
  8. package/Libraries/Pressability/Pressability.js +38 -4
  9. package/Libraries/StyleSheet/normalizeColor.js +0 -0
  10. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +13 -4
  11. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +1 -1
  12. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +5 -2
  13. package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +0 -4
  14. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +3 -20
  15. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +5 -3
  16. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.mm +83 -0
  17. package/React/Base/RCTJavaScriptLoader.h +0 -0
  18. package/React/Base/RCTJavaScriptLoader.mm +0 -0
  19. package/React/Base/RCTVersion.m +1 -1
  20. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +27 -21
  21. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +192 -4
  22. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h +20 -0
  23. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +61 -2
  24. package/React/Fabric/RCTSurfacePointerHandler.mm +6 -2
  25. package/React/Views/RCTComponentData.mm +1 -1
  26. package/React/Views/RCTView.h +1 -0
  27. package/React/Views/RCTViewManager.m +1 -0
  28. package/ReactAndroid/gradle.properties +1 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  30. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  31. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +5 -0
  32. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm +5 -0
  33. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +4 -0
  34. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
  35. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
  36. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.h +2 -0
  37. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEvents.h +6 -0
  38. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.cpp +2 -0
  39. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/MouseEvent.h +8 -0
  40. package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
  41. package/ReactCommon/react/renderer/components/view/propsConversions.h +4 -0
  42. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +2 -0
  43. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +11 -0
  44. package/gradle/libs.versions.toml +1 -1
  45. package/local-cli/cli.js +0 -0
  46. package/package.json +27 -6
  47. package/react-native.config.js +0 -1
  48. package/scripts/compose-source-maps.js +0 -0
  49. package/scripts/featureflags/index.js +47 -0
  50. package/scripts/find-node-for-xcode.sh +0 -0
  51. package/scripts/ios-prebuild/cli.js +136 -0
  52. package/sdks/hermes-engine/utils/build-apple-framework.sh +2 -1
  53. package/sdks/hermes-engine/utils/build-ios-framework.sh +8 -3
  54. package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +0 -0
  55. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  56. package/third-party-podspecs/fmt.podspec +2 -2
  57. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +0 -14
File without changes
File without changes
@@ -44,6 +44,7 @@ const UIView = {
44
44
  mouseDownCanMoveWindow: true,
45
45
  enableFocusRing: true,
46
46
  focusable: true,
47
+ onAuxClick: true,
47
48
  onMouseEnter: true,
48
49
  onMouseLeave: true,
49
50
  onDoubleClick: true,
@@ -135,6 +135,8 @@ type MouseEventProps = $ReadOnly<{
135
135
 
136
136
  // Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
137
137
  type PointerEventProps = $ReadOnly<{
138
+ onAuxClick?: ?(event: PointerEvent) => void,
139
+ onAuxClickCapture?: ?(event: PointerEvent) => void,
138
140
  onClick?: ?(event: PointerEvent) => void,
139
141
  onClickCapture?: ?(event: PointerEvent) => void,
140
142
  onPointerEnter?: ?(event: PointerEvent) => void,
@@ -17,6 +17,6 @@ export const version: $ReadOnly<{
17
17
  }> = {
18
18
  major: 0,
19
19
  minor: 81,
20
- patch: 6,
20
+ patch: 8,
21
21
  prerelease: null,
22
22
  };
@@ -89,6 +89,12 @@ const bubblingEventTypes = {
89
89
  },
90
90
 
91
91
  // Experimental/Work in Progress Pointer Events (not yet ready for use)
92
+ topAuxClick: {
93
+ phasedRegistrationNames: {
94
+ captured: 'onAuxClickCapture',
95
+ bubbled: 'onAuxClick',
96
+ },
97
+ },
92
98
  topClick: {
93
99
  phasedRegistrationNames: {
94
100
  captured: 'onClickCapture',
@@ -394,6 +400,8 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({
394
400
  onTouchCancel: true,
395
401
 
396
402
  // Pointer events
403
+ onAuxClick: true,
404
+ onAuxClickCapture: true,
397
405
  onClick: true,
398
406
  onClickCapture: true,
399
407
  onPointerUp: true,
@@ -410,6 +410,16 @@ export default class Pressability {
410
410
  _touchActivateTime: ?number;
411
411
  _touchState: TouchState = 'NOT_RESPONDER';
412
412
 
413
+ // [macOS
414
+ /**
415
+ * Returns true if the button from a press event is the default (primary/left)
416
+ * button. A button value of 0 or undefined is considered the default button.
417
+ */
418
+ _isDefaultPressButton(button: ?number): boolean {
419
+ return !button;
420
+ }
421
+ // macOS]
422
+
413
423
  constructor(config: PressabilityConfig) {
414
424
  this.configure(config);
415
425
  }
@@ -554,6 +564,13 @@ export default class Pressability {
554
564
  return;
555
565
  }
556
566
 
567
+ // [macOS Only fire onPress for primary (left) mouse button clicks.
568
+ // Non-primary buttons (right, middle) should not trigger onPress.
569
+ if (!this._isDefaultPressButton(event?.nativeEvent?.button)) {
570
+ return;
571
+ }
572
+ // macOS]
573
+
557
574
  // for non-pointer click events (e.g. accessibility clicks), we should only dispatch when we're the "real" target
558
575
  // in particular, we shouldn't respond to clicks from nested pressables
559
576
  if (event?.currentTarget !== event?.target) {
@@ -791,7 +808,12 @@ export default class Pressability {
791
808
 
792
809
  if (isPressInSignal(prevState) && signal === 'LONG_PRESS_DETECTED') {
793
810
  const {onLongPress} = this._config;
794
- if (onLongPress != null) {
811
+ if (
812
+ onLongPress != null &&
813
+ this._isDefaultPressButton(
814
+ getTouchFromPressEvent(event).button,
815
+ ) /* [macOS] */
816
+ ) {
795
817
  onLongPress(event);
796
818
  }
797
819
  }
@@ -799,7 +821,14 @@ export default class Pressability {
799
821
  const isPrevActive = isActiveSignal(prevState);
800
822
  const isNextActive = isActiveSignal(nextState);
801
823
 
802
- if (!isPrevActive && isNextActive) {
824
+ // [macOS Don't activate press visual feedback for non-primary mouse buttons
825
+ // (e.g. right-click, middle-click). They should fire onAuxClick, not onPress.
826
+ const isPrimaryButton = this._isDefaultPressButton(
827
+ getTouchFromPressEvent(event).button,
828
+ );
829
+ // macOS]
830
+
831
+ if (!isPrevActive && isNextActive && isPrimaryButton /* [macOS] */) {
803
832
  this._activate(event);
804
833
  } else if (isPrevActive && !isNextActive) {
805
834
  this._deactivate(event);
@@ -807,12 +836,17 @@ export default class Pressability {
807
836
 
808
837
  if (isPressInSignal(prevState) && signal === 'RESPONDER_RELEASE') {
809
838
  // If we never activated (due to delays), activate and deactivate now.
810
- if (!isNextActive && !isPrevActive) {
839
+ if (!isNextActive && !isPrevActive && isPrimaryButton /* [macOS] */) {
811
840
  this._activate(event);
812
841
  this._deactivate(event);
813
842
  }
814
843
  const {onLongPress, onPress, android_disableSound} = this._config;
815
- if (onPress != null) {
844
+ if (
845
+ onPress != null &&
846
+ this._isDefaultPressButton(
847
+ getTouchFromPressEvent(event).button,
848
+ ) /* [macOS] */
849
+ ) {
816
850
  const isPressCanceledByLongPress =
817
851
  onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN';
818
852
  if (!isPressCanceledByLongPress) {
File without changes
@@ -328,10 +328,19 @@ static RCTUIColor *defaultPlaceholderColor(void) // [macOS]
328
328
  #if !TARGET_OS_OSX // [macOS]
329
329
  [super setAttributedText:attributedText];
330
330
  #else // [macOS
331
- // Break undo coalescing when the text is changed by JS (e.g. autocomplete).
332
- [self breakUndoCoalescing];
333
- // Avoid Exception thrown while executing UI block: *** -[NSBigMutableString replaceCharactersInRange:withString:]: nil argument
334
- [self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
331
+ if (self.ghostTextChanging) {
332
+ // Ghost text changes should not be on the undo stack. Disable undo
333
+ // registration around the text storage mutation so Cmd+Z skips over
334
+ // ghost text insertions/removals.
335
+ [self.undoManager disableUndoRegistration];
336
+ [self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
337
+ [self.undoManager enableUndoRegistration];
338
+ } else {
339
+ // Break undo coalescing when the text is changed by JS (e.g. autocomplete).
340
+ [self breakUndoCoalescing];
341
+ // Avoid Exception thrown while executing UI block: *** -[NSBigMutableString replaceCharactersInRange:withString:]: nil argument
342
+ [self.textStorage setAttributedString:attributedText ?: [NSAttributedString new]];
343
+ }
335
344
  #endif // macOS]
336
345
  [self textDidChange];
337
346
  }
@@ -8,7 +8,7 @@
8
8
  #import <React/RCTBackedTextInputDelegateAdapter.h>
9
9
  #import "RCTBackedTextInputViewProtocol.h" // [macOS
10
10
  #import "RCTBackedTextInputDelegate.h"
11
- #import "../RCTTextUIKit.h" // macOS]
11
+ #import <React/RCTTextUIKit.h> // macOS]
12
12
 
13
13
  #pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField)
14
14
 
@@ -21,8 +21,11 @@
21
21
  #import <React/RCTTextAttributes.h>
22
22
  #import <React/RCTTextSelection.h>
23
23
  #import <React/RCTUITextView.h> // [macOS]
24
- #import "../RCTTextUIKit.h" // [macOS]
24
+ #import <React/RCTTextUIKit.h> // [macOS]
25
25
  #import <React/RCTHandledKey.h> // [macOS]
26
+ #if TARGET_OS_OSX // [macOS
27
+ #import <React/RCTUISecureTextField.h>
28
+ #endif // macOS]
26
29
 
27
30
  /** Native iOS text field bottom keyboard offset amount */
28
31
  static const CGFloat kSingleLineKeyboardBottomOffset = 15.0;
@@ -194,7 +197,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
194
197
  BOOL shouldFallbackToBareTextComparison =
195
198
  // There are multiple Korean input sources (2-Set, 3-Set, etc). Check substring instead instead
196
199
  [[[self.backedTextInputView inputContext] selectedKeyboardInputSource] containsString:@"com.apple.inputmethod.Korean"] ||
197
- [self.backedTextInputView hasMarkedText] || [self.backedTextInputView isKindOfClass:[NSSecureTextField class]] ||
200
+ [self.backedTextInputView hasMarkedText] || [self.backedTextInputView isKindOfClass:[RCTUISecureTextField class]] ||
198
201
  #endif // macOS]
199
202
  fontHasBeenUpdatedBySystem;
200
203
 
@@ -20,11 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
20
20
  #if !TARGET_OS_OSX // [macOS]
21
21
  @interface RCTUITextField : UITextField <RCTBackedTextInputViewProtocol>
22
22
  #else // [macOS
23
- #if RCT_SUBCLASS_SECURETEXTFIELD
24
- @interface RCTUISecureTextField : NSSecureTextField <RCTBackedTextInputViewProtocol>
25
- #else
26
23
  @interface RCTUITextField : NSTextField <RCTBackedTextInputViewProtocol>
27
- #endif // RCT_SUBCLASS_SECURETEXTFIELD
28
24
  #endif // macOS]
29
25
 
30
26
 
@@ -17,12 +17,7 @@
17
17
 
18
18
  #if TARGET_OS_OSX // [macOS
19
19
 
20
- #if RCT_SUBCLASS_SECURETEXTFIELD
21
- #define RCTUITextFieldCell RCTUISecureTextFieldCell
22
- @interface RCTUISecureTextFieldCell : NSSecureTextFieldCell
23
- #else
24
20
  @interface RCTUITextFieldCell : NSTextFieldCell
25
- #endif
26
21
 
27
22
  @property (nonatomic, assign) UIEdgeInsets textContainerInset;
28
23
  @property (nonatomic, getter=isAutomaticTextReplacementEnabled) BOOL automaticTextReplacementEnabled;
@@ -36,11 +31,6 @@
36
31
 
37
32
  @implementation RCTUITextFieldCell
38
33
 
39
- - (void)setTextContainerInset:(UIEdgeInsets)textContainerInset
40
- {
41
- _textContainerInset = textContainerInset;
42
- }
43
-
44
34
  - (NSRect)titleRectForBounds:(NSRect)rect
45
35
  {
46
36
  return UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
@@ -58,12 +48,9 @@
58
48
 
59
49
  - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
60
50
  {
61
- if (self.drawsBackground) {
62
- if (self.backgroundColor && self.backgroundColor.alphaComponent > 0) {
63
-
64
- [self.backgroundColor set];
65
- NSRectFill(cellFrame);
66
- }
51
+ if (self.drawsBackground && self.backgroundColor && self.backgroundColor.alphaComponent > 0) {
52
+ [self.backgroundColor set];
53
+ NSRectFill(cellFrame);
67
54
  }
68
55
 
69
56
  [super drawInteriorWithFrame:[self titleRectForBounds:cellFrame] inView:controlView];
@@ -86,11 +73,7 @@
86
73
  @end
87
74
  #endif // macOS]
88
75
 
89
- #ifdef RCT_SUBCLASS_SECURETEXTFIELD
90
- @implementation RCTUISecureTextField {
91
- #else
92
76
  @implementation RCTUITextField {
93
- #endif
94
77
  RCTBackedTextFieldDelegateAdapter *_textInputDelegateAdapter;
95
78
  NSDictionary<NSAttributedStringKey, id> *_defaultTextAttributes;
96
79
  #if !TARGET_OS_OSX // [macOS]
@@ -8,8 +8,10 @@
8
8
  // [macOS]
9
9
 
10
10
  #if TARGET_OS_OSX
11
- #define RCT_SUBCLASS_SECURETEXTFIELD 1
12
- #endif
13
11
 
14
- #include <React/RCTUITextField.h>
12
+ #import <React/RCTUITextField.h>
13
+
14
+ @interface RCTUISecureTextField : RCTUITextField
15
+ @end
15
16
 
17
+ #endif
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ // [macOS]
9
+
10
+ #if TARGET_OS_OSX
11
+
12
+ #import <React/RCTUISecureTextField.h>
13
+ #import <React/RCTUIKit.h>
14
+
15
+ #pragma mark - RCTUISecureTextFieldCell
16
+
17
+ @interface RCTUISecureTextFieldCell : NSSecureTextFieldCell
18
+
19
+ @property (nonatomic, assign) UIEdgeInsets textContainerInset;
20
+ @property (nonatomic, getter=isAutomaticTextReplacementEnabled) BOOL automaticTextReplacementEnabled;
21
+ @property (nonatomic, getter=isAutomaticSpellingCorrectionEnabled) BOOL automaticSpellingCorrectionEnabled;
22
+ @property (nonatomic, getter=isContinuousSpellCheckingEnabled) BOOL continuousSpellCheckingEnabled;
23
+ @property (nonatomic, getter=isGrammarCheckingEnabled) BOOL grammarCheckingEnabled;
24
+ @property (nonatomic, strong, nullable) RCTPlatformColor *selectionColor;
25
+ @property (nonatomic, strong, nullable) RCTPlatformColor *insertionPointColor;
26
+
27
+ @end
28
+
29
+ @implementation RCTUISecureTextFieldCell
30
+
31
+ - (NSRect)titleRectForBounds:(NSRect)rect
32
+ {
33
+ return UIEdgeInsetsInsetRect([super titleRectForBounds:rect], self.textContainerInset);
34
+ }
35
+
36
+ - (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event
37
+ {
38
+ [super editWithFrame:[self titleRectForBounds:rect] inView:controlView editor:textObj delegate:delegate event:event];
39
+ }
40
+
41
+ - (void)selectWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate start:(NSInteger)selStart length:(NSInteger)selLength
42
+ {
43
+ [super selectWithFrame:[self titleRectForBounds:rect] inView:controlView editor:textObj delegate:delegate start:selStart length:selLength];
44
+ }
45
+
46
+ - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
47
+ {
48
+ if (self.drawsBackground && self.backgroundColor && self.backgroundColor.alphaComponent > 0) {
49
+ [self.backgroundColor set];
50
+ NSRectFill(cellFrame);
51
+ }
52
+
53
+ [super drawInteriorWithFrame:[self titleRectForBounds:cellFrame] inView:controlView];
54
+ }
55
+
56
+ - (NSText *)setUpFieldEditorAttributes:(NSText *)textObj
57
+ {
58
+ NSTextView *fieldEditor = (NSTextView *)[super setUpFieldEditorAttributes:textObj];
59
+ fieldEditor.automaticSpellingCorrectionEnabled = self.isAutomaticSpellingCorrectionEnabled;
60
+ fieldEditor.automaticTextReplacementEnabled = self.isAutomaticTextReplacementEnabled;
61
+ fieldEditor.continuousSpellCheckingEnabled = self.isContinuousSpellCheckingEnabled;
62
+ fieldEditor.grammarCheckingEnabled = self.isGrammarCheckingEnabled;
63
+ NSMutableDictionary *selectTextAttributes = fieldEditor.selectedTextAttributes.mutableCopy;
64
+ selectTextAttributes[NSBackgroundColorAttributeName] = self.selectionColor ?: [NSColor selectedControlColor];
65
+ fieldEditor.selectedTextAttributes = selectTextAttributes;
66
+ fieldEditor.insertionPointColor = self.insertionPointColor ?: [NSColor textColor];
67
+ return fieldEditor;
68
+ }
69
+
70
+ @end
71
+
72
+ #pragma mark - RCTUISecureTextField
73
+
74
+ @implementation RCTUISecureTextField
75
+
76
+ + (Class)cellClass
77
+ {
78
+ return RCTUISecureTextFieldCell.class;
79
+ }
80
+
81
+ @end
82
+
83
+ #endif // TARGET_OS_OSX
File without changes
File without changes
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(81),
26
- RCTVersionPatch: @(6),
26
+ RCTVersionPatch: @(8),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -157,7 +157,9 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NS
157
157
  #if !TARGET_OS_OSX // [macOS]
158
158
  [_scrollView addSubview:_containerView];
159
159
  #else // [macOS
160
- _containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
160
+ // Force overlay scrollbar style to avoid layout issues with legacy scrollbars.
161
+ _scrollView.scrollerStyle = NSScrollerStyleOverlay;
162
+ // Don't set autoresizingMask — AppKit corrupts the documentView frame during tile/resize.
161
163
  [_scrollView setDocumentView:_containerView];
162
164
  #endif // macOS]
163
165
 
@@ -185,26 +187,11 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(RCTUIScrollView *scrollView, NS
185
187
  }
186
188
 
187
189
  #if TARGET_OS_OSX // [macOS
188
- - (void)layoutSubviews
189
- {
190
- [super layoutSubviews];
191
-
192
- // On macOS, the _containerView is the NSScrollView's documentView and has autoresizingMask set so
193
- // it fills the visible area before React's first layout pass. However, AppKit's autoresizing can
194
- // corrupt the documentView's frame by adding the NSClipView's size delta to the container's
195
- // dimensions (e.g., during initial tile or window resize), inflating it well beyond the correct
196
- // content size. This produces massive horizontal and vertical overflow on first render.
197
- //
198
- // After React has set the content size via updateState:, we reset the documentView frame here to
199
- // undo any autoresizing corruption. This runs after AppKit's layout (which triggers autoresizing),
200
- // so it reliably corrects the frame.
201
- if (!CGSizeEqualToSize(_contentSize, CGSizeZero)) {
202
- CGRect containerFrame = _containerView.frame;
203
- if (!CGSizeEqualToSize(containerFrame.size, _contentSize)) {
204
- containerFrame.size = _contentSize;
205
- _containerView.frame = containerFrame;
206
- }
207
- }
190
+ - (void)_preferredScrollerStyleDidChange:(NSNotification *)notification
191
+ {
192
+ // Re-force overlay style when system preference changes.
193
+ _scrollView.scrollerStyle = NSScrollerStyleOverlay;
194
+ [_scrollView tile];
208
195
  }
209
196
  #endif // macOS]
210
197
 
@@ -585,6 +572,18 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
585
572
  return nil;
586
573
  }
587
574
 
575
+ #if TARGET_OS_OSX // [macOS
576
+ // Check scrollbars before content subviews — scrollers are NSScrollView children,
577
+ // not documentView children, so full-width content would swallow their clicks.
578
+ if (isPointInside) {
579
+ NSPoint scrollViewPoint = [_scrollView convertPoint:point fromView:self];
580
+ NSView *scrollViewHit = [_scrollView hitTest:scrollViewPoint];
581
+ if ([scrollViewHit isKindOfClass:[NSScroller class]]) {
582
+ return (RCTPlatformView *)scrollViewHit;
583
+ }
584
+ }
585
+ #endif // macOS]
586
+
588
587
  for (RCTPlatformView *subview in [_containerView.subviews reverseObjectEnumerator]) { // [macOS]
589
588
  RCTPlatformView *hitView = RCTUIViewHitTestWithEvent(subview, point, self, event); // [macOS]
590
589
  if (hitView) {
@@ -889,12 +888,19 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
889
888
  [defaultCenter removeObserver:self
890
889
  name:NSViewBoundsDidChangeNotification
891
890
  object:_scrollView.contentView];
891
+ [defaultCenter removeObserver:self
892
+ name:NSPreferredScrollerStyleDidChangeNotification
893
+ object:nil];
892
894
  } else {
893
895
  // Register for scrollview's clipview bounds change notifications so we can track scrolling
894
896
  [defaultCenter addObserver:self
895
897
  selector:@selector(scrollViewDocumentViewBoundsDidChange:)
896
898
  name:NSViewBoundsDidChangeNotification
897
899
  object:_scrollView.contentView]; // NSClipView
900
+ [defaultCenter addObserver:self
901
+ selector:@selector(_preferredScrollerStyleDidChange:)
902
+ name:NSPreferredScrollerStyleDidChangeNotification
903
+ object:nil];
898
904
  }
899
905
  #endif // macOS]
900
906