@lodev09/react-native-true-sheet 3.3.0 → 3.3.1
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.
|
@@ -124,11 +124,28 @@ using namespace facebook::react;
|
|
|
124
124
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil];
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
- (TrueSheetViewController *)findSheetViewController {
|
|
128
|
+
UIResponder *responder = self;
|
|
129
|
+
while (responder) {
|
|
130
|
+
if ([responder isKindOfClass:[TrueSheetViewController class]]) {
|
|
131
|
+
return (TrueSheetViewController *)responder;
|
|
132
|
+
}
|
|
133
|
+
responder = responder.nextResponder;
|
|
134
|
+
}
|
|
135
|
+
return nil;
|
|
136
|
+
}
|
|
137
|
+
|
|
127
138
|
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
|
|
128
139
|
if (!_bottomConstraint) {
|
|
129
140
|
return;
|
|
130
141
|
}
|
|
131
142
|
|
|
143
|
+
// Only respond to keyboard if this sheet is the topmost presented controller
|
|
144
|
+
TrueSheetViewController *sheetController = [self findSheetViewController];
|
|
145
|
+
if (sheetController && !sheetController.isTopmostPresentedController) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
132
149
|
NSDictionary *userInfo = notification.userInfo;
|
|
133
150
|
CGRect keyboardFrame = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
|
134
151
|
NSTimeInterval duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
|
|
@@ -66,6 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
66
66
|
@property (nonatomic, copy, nullable) NSString *insetAdjustment;
|
|
67
67
|
@property (nonatomic, assign) BOOL isPresented;
|
|
68
68
|
@property (nonatomic, assign) NSInteger activeDetentIndex;
|
|
69
|
+
@property (nonatomic, readonly) BOOL isTopmostPresentedController;
|
|
69
70
|
|
|
70
71
|
- (void)applyActiveDetent;
|
|
71
72
|
- (void)setupActiveDetentWithIndex:(NSInteger)index;
|
package/package.json
CHANGED