@lodev09/react-native-true-sheet 3.9.3 → 3.9.4

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.
@@ -61,6 +61,7 @@ using namespace facebook::react;
61
61
  BOOL _dismissedByNavigation;
62
62
  BOOL _pendingNavigationRepresent;
63
63
  BOOL _pendingMountEvent;
64
+ BOOL _pendingSizeChange;
64
65
  RNScreensEventObserver *_screensEventObserver;
65
66
  }
66
67
 
@@ -552,9 +553,14 @@ using namespace facebook::react;
552
553
  * Debounced sheet update to handle rapid content/header size changes.
553
554
  */
554
555
  - (void)setupSheetDetentsForSizeChange {
555
- if (!_controller.isPresented || _isSheetUpdatePending)
556
+ if (_isSheetUpdatePending)
556
557
  return;
557
558
 
559
+ if (!_controller.isPresented) {
560
+ _pendingSizeChange = YES;
561
+ return;
562
+ }
563
+
558
564
  _isSheetUpdatePending = YES;
559
565
 
560
566
  dispatch_async(dispatch_get_main_queue(), ^{
@@ -586,6 +592,11 @@ using namespace facebook::react;
586
592
  - (void)viewControllerDidPresentAtIndex:(NSInteger)index position:(CGFloat)position detent:(CGFloat)detent {
587
593
  [_containerView setupKeyboardObserverWithViewController:_controller];
588
594
  [TrueSheetLifecycleEvents emitDidPresent:_eventEmitter index:index position:position detent:detent];
595
+
596
+ if (_pendingSizeChange) {
597
+ _pendingSizeChange = NO;
598
+ [self setupSheetDetentsForSizeChange];
599
+ }
589
600
  }
590
601
 
591
602
  - (void)viewControllerDidDrag:(UIGestureRecognizerState)state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
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",