react-native-screens 4.19.0-nightly-20251214-c9b84ff7a → 4.20.0-nightly-20251215-f65b107bd
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.
package/ios/RNSScreen.mm
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
#import <React/RCTUIManagerUtils.h>
|
|
31
31
|
|
|
32
32
|
#import "RNSConversions.h"
|
|
33
|
+
#import "RNSSafeAreaViewComponentView.h"
|
|
33
34
|
#import "RNSSafeAreaViewNotifications.h"
|
|
34
35
|
#import "RNSScreenFooter.h"
|
|
35
36
|
#import "RNSScreenStack.h"
|
|
@@ -902,7 +903,8 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
902
903
|
// Step 1: Query registered content wrapper for the scrollview.
|
|
903
904
|
RNSScreenContentWrapper *contentWrapper = _contentWrapperBox.contentWrapper;
|
|
904
905
|
|
|
905
|
-
if (RNS_REACT_SCROLL_VIEW_COMPONENT *_Nullable scrollViewComponent =
|
|
906
|
+
if (RNS_REACT_SCROLL_VIEW_COMPONENT *_Nullable scrollViewComponent =
|
|
907
|
+
[contentWrapper childRCTScrollViewComponentAndContentContainer].scrollViewComponent;
|
|
906
908
|
scrollViewComponent != nil) {
|
|
907
909
|
return scrollViewComponent;
|
|
908
910
|
}
|
|
@@ -916,6 +918,20 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
916
918
|
}
|
|
917
919
|
}
|
|
918
920
|
|
|
921
|
+
#if RNS_IPHONE_OS_VERSION_AVAILABLE(26_0)
|
|
922
|
+
// Fallback 2: Search through RNSSafeAreaViewComponentView subviews (iOS 26+ workaround with modified hierarchy)
|
|
923
|
+
if (@available(iOS 26.0, *)) {
|
|
924
|
+
UIView *maybeSafeAreaView = contentWrapper.subviews.firstObject;
|
|
925
|
+
if ([maybeSafeAreaView isKindOfClass:RNSSafeAreaViewComponentView.class]) {
|
|
926
|
+
for (UIView *subview in maybeSafeAreaView.subviews) {
|
|
927
|
+
if ([subview isKindOfClass:RNS_REACT_SCROLL_VIEW_COMPONENT.class]) {
|
|
928
|
+
return static_cast<RNS_REACT_SCROLL_VIEW_COMPONENT *>(subview);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
#endif // RNS_IPHONE_OS_VERSION_AVAILABLE(26_0)
|
|
934
|
+
|
|
919
935
|
return nil;
|
|
920
936
|
}
|
|
921
937
|
|
|
@@ -25,6 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
25
25
|
|
|
26
26
|
@end
|
|
27
27
|
|
|
28
|
+
typedef struct {
|
|
29
|
+
RNS_REACT_SCROLL_VIEW_COMPONENT *scrollViewComponent;
|
|
30
|
+
UIView *contentContainerView;
|
|
31
|
+
} RNSScrollViewSearchResult;
|
|
32
|
+
|
|
28
33
|
@interface RNSScreenContentWrapper :
|
|
29
34
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
30
35
|
RCTViewComponentView
|
|
@@ -39,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
39
44
|
*/
|
|
40
45
|
- (void)triggerDelegateUpdate;
|
|
41
46
|
|
|
42
|
-
- (
|
|
47
|
+
- (RNSScrollViewSearchResult)childRCTScrollViewComponentAndContentContainer;
|
|
43
48
|
|
|
44
49
|
- (BOOL)coerceChildScrollViewComponentSizeToSize:(CGSize)size;
|
|
45
50
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#import "RNSScreenContentWrapper.h"
|
|
2
2
|
#import "RNSDefines.h"
|
|
3
|
+
#import "RNSSafeAreaViewComponentView.h"
|
|
3
4
|
#import "RNSScreen.h"
|
|
4
5
|
#import "RNSScreenStack.h"
|
|
5
6
|
|
|
@@ -106,32 +107,55 @@ namespace react = facebook::react;
|
|
|
106
107
|
return static_cast<RNSScreenView *_Nullable>(currentView);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
- (
|
|
110
|
+
- (RNSScrollViewSearchResult)childRCTScrollViewComponentAndContentContainer
|
|
110
111
|
{
|
|
112
|
+
// Directly search subviews
|
|
111
113
|
for (UIView *subview in self.subviews) {
|
|
112
114
|
if ([subview isKindOfClass:RNS_REACT_SCROLL_VIEW_COMPONENT.class]) {
|
|
113
|
-
return static_cast<RNS_REACT_SCROLL_VIEW_COMPONENT *>(subview)
|
|
115
|
+
return (RNSScrollViewSearchResult){.scrollViewComponent = static_cast<RNS_REACT_SCROLL_VIEW_COMPONENT *>(subview),
|
|
116
|
+
.contentContainerView = self};
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
|
-
|
|
119
|
+
|
|
120
|
+
// Fallback 1: Search through RNSSafeAreaViewComponentView subviews (iOS 26+ workaround with modified hierarchy)
|
|
121
|
+
#if RNS_IPHONE_OS_VERSION_AVAILABLE(26_0)
|
|
122
|
+
if (@available(iOS 26.0, *)) {
|
|
123
|
+
UIView *maybeSafeAreaView = self.subviews.firstObject;
|
|
124
|
+
if ([maybeSafeAreaView isKindOfClass:RNSSafeAreaViewComponentView.class]) {
|
|
125
|
+
for (UIView *subview in maybeSafeAreaView.subviews) {
|
|
126
|
+
if ([subview isKindOfClass:RNS_REACT_SCROLL_VIEW_COMPONENT.class]) {
|
|
127
|
+
return (RNSScrollViewSearchResult){
|
|
128
|
+
.scrollViewComponent = static_cast<RNS_REACT_SCROLL_VIEW_COMPONENT *>(subview),
|
|
129
|
+
.contentContainerView = maybeSafeAreaView};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
#endif // RNS_IPHONE_OS_VERSION_AVAILABLE(26_0)
|
|
135
|
+
|
|
136
|
+
return (RNSScrollViewSearchResult){.scrollViewComponent = nullptr, .contentContainerView = nullptr};
|
|
117
137
|
}
|
|
118
138
|
|
|
119
139
|
- (BOOL)coerceChildScrollViewComponentSizeToSize:(CGSize)size
|
|
120
140
|
{
|
|
121
|
-
|
|
141
|
+
auto scrollViewComponentAndContentContainerPair = [self childRCTScrollViewComponentAndContentContainer];
|
|
142
|
+
RNS_REACT_SCROLL_VIEW_COMPONENT *_Nullable scrollViewComponent =
|
|
143
|
+
scrollViewComponentAndContentContainerPair.scrollViewComponent;
|
|
144
|
+
UIView *_Nullable containerView = scrollViewComponentAndContentContainerPair.contentContainerView;
|
|
122
145
|
|
|
123
146
|
if (scrollViewComponent == nil) {
|
|
124
147
|
return NO;
|
|
125
148
|
}
|
|
126
149
|
|
|
127
|
-
if (
|
|
150
|
+
if (containerView.subviews.count > 2) {
|
|
128
151
|
RCTLogWarn(
|
|
129
|
-
@"[RNScreens] FormSheet with ScrollView expects at most 2 subviews. Got %ld
|
|
152
|
+
@"[RNScreens] FormSheet with ScrollView expects at most 2 subviews. Got %ld for container: %@. This might result in incorrect layout. \
|
|
130
153
|
If you want to display header alongside the scrollView, make sure to apply `collapsable: false` on your header component view.",
|
|
131
|
-
|
|
154
|
+
containerView.subviews.count,
|
|
155
|
+
NSStringFromClass(containerView.class));
|
|
132
156
|
}
|
|
133
157
|
|
|
134
|
-
NSUInteger scrollViewComponentIndex = [
|
|
158
|
+
NSUInteger scrollViewComponentIndex = [containerView.subviews indexOfObject:scrollViewComponent];
|
|
135
159
|
|
|
136
160
|
// Case 1: ScrollView first child - takes whole size.
|
|
137
161
|
if (scrollViewComponentIndex == 0) {
|
|
@@ -143,7 +167,7 @@ namespace react = facebook::react;
|
|
|
143
167
|
|
|
144
168
|
// Case 2: There is a header - we adjust scrollview size by the header height.
|
|
145
169
|
if (scrollViewComponentIndex == 1) {
|
|
146
|
-
UIView *headerView =
|
|
170
|
+
UIView *headerView = containerView.subviews[0];
|
|
147
171
|
CGRect newFrame = scrollViewComponent.frame;
|
|
148
172
|
newFrame.size = size;
|
|
149
173
|
newFrame.size.height -= headerView.frame.size.height;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screens",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.0-nightly-20251215-f65b107bd",
|
|
4
4
|
"description": "Native navigation primitives for your React Native app.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"submodules": "git submodule update --init --recursive && (cd react-navigation && yarn && yarn build && cd ../)",
|