@lodev09/react-native-true-sheet 3.11.17 → 3.11.18
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.
|
@@ -264,6 +264,7 @@ class TrueSheetContentView(private val reactContext: ThemedReactContext) : React
|
|
|
264
264
|
private fun scrollToFocusedInput() {
|
|
265
265
|
val scrollView = pinnedScrollView ?: findScrollView() ?: return
|
|
266
266
|
val focusedView = findFocus() ?: return
|
|
267
|
+
if (!focusedView.isDescendantOf(scrollView)) return
|
|
267
268
|
|
|
268
269
|
val focusedLocation = IntArray(2)
|
|
269
270
|
val scrollViewLocation = IntArray(2)
|
|
@@ -23,12 +23,14 @@ object TrueSheetStackManager {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Returns the topmost presented and visible sheet.
|
|
26
|
+
* Returns the topmost presented and visible sheet, skipping sheets that are dismissing.
|
|
27
|
+
* A dismissing sheet can't parent a new one: its dim would suppress the child's own dim
|
|
28
|
+
* and then disappear with it, leaving the child undimmed.
|
|
27
29
|
* Must be called within synchronized block.
|
|
28
30
|
*/
|
|
29
31
|
private fun findTopmostSheet(): TrueSheetView? =
|
|
30
32
|
presentedSheetStack.lastOrNull {
|
|
31
|
-
it.viewController.isPresented &&
|
|
33
|
+
it.viewController.run { isPresented && isSheetVisible && !isBeingDismissed }
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -322,11 +322,12 @@ using namespace facebook::react;
|
|
|
322
322
|
|
|
323
323
|
TrueSheetViewController *sheetController = _keyboardObserver.viewController;
|
|
324
324
|
UIView *firstResponder = sheetController ? [sheetController.view findFirstResponder] : nil;
|
|
325
|
-
|
|
325
|
+
UIScrollView *scrollView = _pinnedScrollView.scrollView;
|
|
326
|
+
// An input outside the scrollable (e.g. in the footer) can't be revealed by scrolling it
|
|
327
|
+
if (!firstResponder || ![firstResponder isDescendantOfView:scrollView]) {
|
|
326
328
|
return;
|
|
327
329
|
}
|
|
328
330
|
|
|
329
|
-
UIScrollView *scrollView = _pinnedScrollView.scrollView;
|
|
330
331
|
CGRect targetRect = [firstResponder convertRect:firstResponder.bounds toView:scrollView];
|
|
331
332
|
|
|
332
333
|
if ([firstResponder conformsToProtocol:@protocol(UITextInput)]) {
|
package/package.json
CHANGED