Skip to content

Commit 484018e

Browse files
authored
Merge branch 'main' into more-2
2 parents c1df4ad + fdfba41 commit 484018e

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

packages/react-native/Libraries/Text/TextInput/Multiline/RCTWrappedTextView.m

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ - (instancetype)initWithFrame:(CGRect)frame
7171
return self;
7272
}
7373

74-
- (void)dealloc
75-
{
76-
[[NSNotificationCenter defaultCenter] removeObserver:self];
77-
}
78-
7974
- (BOOL)isFlipped
8075
{
8176
return YES;
@@ -155,13 +150,8 @@ - (BOOL)scrollEnabled
155150

156151
- (void)setScrollEnabled:(BOOL)scrollEnabled
157152
{
158-
if (scrollEnabled) {
159-
_scrollView.scrollEnabled = YES;
160-
[_clipView setConstrainScrolling:NO];
161-
} else {
162-
_scrollView.scrollEnabled = NO;
163-
[_clipView setConstrainScrolling:YES];
164-
}
153+
_scrollView.scrollEnabled = scrollEnabled;
154+
[_clipView setConstrainScrolling:!scrollEnabled];
165155
}
166156

167157
- (BOOL)shouldShowVerticalScrollbar

packages/react-native/React/Base/macOS/RCTUIKit.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ @implementation RCTUIView
129129
BOOL _clipsToBounds;
130130
BOOL _userInteractionEnabled;
131131
BOOL _mouseDownCanMoveWindow;
132+
BOOL _respondsToDisplayLayer;
132133
}
133134

134135
+ (NSSet<NSString *> *)keyPathsForValuesAffectingValueForKey:(NSString *)key
@@ -158,6 +159,7 @@ @implementation RCTUIView
158159
self->_userInteractionEnabled = YES;
159160
self->_enableFocusRing = YES;
160161
self->_mouseDownCanMoveWindow = YES;
162+
self->_respondsToDisplayLayer = [self respondsToSelector:@selector(displayLayer:)];
161163
}
162164
return self;
163165
}
@@ -259,7 +261,12 @@ - (void)updateLayer
259261
// so it has to be reset from the view's NSColor ivar.
260262
[layer setBackgroundColor:[_backgroundColor CGColor]];
261263
}
262-
[(id<CALayerDelegate>)self displayLayer:layer];
264+
265+
// In Fabric, wantsUpdateLayer is always enabled and doesn't guarantee that
266+
// the instance has a displayLayer method.
267+
if (_respondsToDisplayLayer) {
268+
[(id<CALayerDelegate>)self displayLayer:layer];
269+
}
263270
}
264271

265272
- (void)drawRect:(CGRect)rect

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,11 @@ - (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
20252025
return RCTNSStringFromString([[self class] componentDescriptorProvider].name);
20262026
}
20272027

2028+
- (BOOL)wantsUpdateLayer
2029+
{
2030+
return YES;
2031+
}
2032+
20282033
@end
20292034

20302035
#ifdef __cplusplus

0 commit comments

Comments
 (0)