@lodev09/react-native-true-sheet 4.0.0-beta.22 → 4.0.0-beta.23

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.
@@ -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 && it.viewController.isSheetVisible
33
+ it.viewController.run { isPresented && isSheetVisible && !isBeingDismissed }
32
34
  }
33
35
 
34
36
  /**
@@ -442,11 +442,12 @@ using namespace facebook::react;
442
442
 
443
443
  TrueSheetViewController *sheetController = _keyboardObserver.viewController;
444
444
  UIView *firstResponder = sheetController ? [sheetController.view findFirstResponder] : nil;
445
- if (!firstResponder) {
445
+ UIScrollView *scrollView = _detectedScrollView.scrollView;
446
+ // An input outside the scrollable (e.g. in the footer) can't be revealed by scrolling it
447
+ if (!firstResponder || ![firstResponder isDescendantOfView:scrollView]) {
446
448
  return;
447
449
  }
448
450
 
449
- UIScrollView *scrollView = _detectedScrollView.scrollView;
450
451
  CGRect targetRect = [firstResponder convertRect:firstResponder.bounds toView:scrollView];
451
452
 
452
453
  if ([firstResponder conformsToProtocol:@protocol(UITextInput)]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "4.0.0-beta.22",
3
+ "version": "4.0.0-beta.23",
4
4
  "description": "The true native bottom sheet experience for your React Native Apps.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",