@lodev09/react-native-true-sheet 3.9.0-beta.6 → 3.9.0

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.
@@ -551,10 +551,9 @@ class TrueSheetView(private val reactContext: ThemedReactContext) :
551
551
  }
552
552
 
553
553
  override fun viewControllerDidChangeSize(width: Int, height: Int) {
554
- // When scrollable, pass actual height so Yoga container matches the real sheet size
555
- // (content uses flex:1, needs correct bounds for padding/layout).
556
- // When not scrollable, keep height at screen size to avoid feedback loop with "auto" detent.
557
- val effectiveHeight = if (viewController.scrollable) height else lastContainerHeight
554
+ // On android scrollable, we need the actual sheet height to get proper ScrollView height.
555
+ // Unlike IOS where ScrollView is pinned to the container.
556
+ val effectiveHeight = if (viewController.scrollable) height else viewController.screenHeight
558
557
  updateState(width, effectiveHeight)
559
558
  }
560
559
 
@@ -268,9 +268,9 @@ using namespace facebook::react;
268
268
  - (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState {
269
269
  _state = std::static_pointer_cast<TrueSheetViewShadowNode::ConcreteState const>(state);
270
270
 
271
- // Initialize with _controller size to set initial width
272
271
  if (_controller) {
273
- [self updateStateWithSize:_controller.view.frame.size];
272
+ // Initialize with _controller size to set initial width
273
+ [self viewControllerDidChangeSize:_controller.view.frame.size];
274
274
  }
275
275
  }
276
276
 
@@ -640,12 +640,10 @@ using namespace facebook::react;
640
640
  }
641
641
 
642
642
  - (void)viewControllerDidChangeSize:(CGSize)size {
643
- // When scrollable, pass actual height so Yoga container matches the real sheet size
644
- // (content uses flex:1, needs correct bounds for padding/layout).
645
- // When not scrollable, keep height at screen size to avoid feedback loop with "auto" detent.
646
- CGFloat effectiveHeight = _scrollable ? size.height : _lastStateSize.height;
647
- CGSize adjustedSize = CGSizeMake(size.width, effectiveHeight);
648
- [self updateStateWithSize:adjustedSize];
643
+ // TODO: Explicit screen height for now until synchronous layout is supported.
644
+ CGSize effectiveSize = CGSizeMake(size.width, _controller.screenHeight);
645
+
646
+ [self updateStateWithSize:effectiveSize];
649
647
  }
650
648
 
651
649
  - (void)viewControllerWillFocus {
@@ -219,7 +219,6 @@ using namespace facebook::react;
219
219
  dispatch_async(dispatch_get_main_queue(), ^{
220
220
  NSInteger index = [self currentDetentIndex];
221
221
  CGFloat detent = [self detentValueForIndex:index];
222
- [self.delegate viewControllerDidChangeSize:self.view.frame.size];
223
222
  [self.delegate viewControllerDidPresentAtIndex:index position:self.currentPosition detent:detent];
224
223
  [self.delegate viewControllerDidFocus];
225
224
 
@@ -314,7 +313,6 @@ using namespace facebook::react;
314
313
  dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
315
314
  [self storeResolvedPositionForIndex:pendingIndex];
316
315
  CGFloat detent = [self detentValueForIndex:pendingIndex];
317
- [self.delegate viewControllerDidChangeSize:self.view.frame.size];
318
316
  [self.delegate viewControllerDidChangeDetent:pendingIndex position:self.currentPosition detent:detent];
319
317
  [self emitChangePositionDelegateWithPosition:self.currentPosition realtime:NO debug:@"pending detent change"];
320
318
  });
@@ -809,7 +807,6 @@ using namespace facebook::react;
809
807
  NSInteger index = self.currentDetentIndex;
810
808
  if (index >= 0) {
811
809
  CGFloat detent = [self detentValueForIndex:index];
812
- [self.delegate viewControllerDidChangeSize:self.view.frame.size];
813
810
  [self.delegate viewControllerDidChangeDetent:index position:self.currentPosition detent:detent];
814
811
  }
815
812
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.9.0-beta.6",
3
+ "version": "3.9.0",
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",