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

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.
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/lodev09/react-native-true-sheet/actions/workflows/checks.yml/badge.svg)](https://github.com/lodev09/react-native-true-sheet/actions/workflows/checks.yml)
4
4
  [![NPM Downloads](https://img.shields.io/npm/d18m/%40lodev09%2Freact-native-true-sheet)](https://www.npmjs.com/package/@lodev09/react-native-true-sheet)
5
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lodev09/react-native-true-sheet)
5
6
 
6
7
  The true native bottom sheet experience for your React Native Apps. 💩
7
8
 
@@ -37,7 +38,7 @@ The true native bottom sheet experience for your React Native Apps. 💩
37
38
  | TrueSheet | React Native | Expo SDK |
38
39
  |-----------|--------------|----------|
39
40
  | 3.7+ | 0.81+ | 54+ |
40
- | 3.6 | 0.79 | 52-53 |
41
+ | 3.6 | 0.80 | 52-53 |
41
42
 
42
43
  ### Expo
43
44
 
@@ -551,7 +551,11 @@ class TrueSheetView(private val reactContext: ThemedReactContext) :
551
551
  }
552
552
 
553
553
  override fun viewControllerDidChangeSize(width: Int, height: Int) {
554
- updateState(width, height)
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
558
+ updateState(width, effectiveHeight)
555
559
  }
556
560
 
557
561
  override fun viewControllerWillFocus() {
@@ -454,7 +454,6 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
454
454
  sheetView?.let { emitChangePositionDelegate(it.top, realtime = false) }
455
455
  }
456
456
 
457
- override val isScrollable: Boolean get() = scrollable
458
457
  override fun findScrollView(): ScrollView? = containerView?.contentView?.findScrollView()
459
458
  override fun findSheetView(): TrueSheetBottomSheetView? = sheetView
460
459
 
@@ -12,7 +12,6 @@ import com.facebook.react.uimanager.ReactPointerEventsView
12
12
  import com.lodev09.truesheet.utils.isDescendantOf
13
13
 
14
14
  interface TrueSheetCoordinatorLayoutDelegate {
15
- val isScrollable: Boolean
16
15
  fun coordinatorLayoutDidLayout(changed: Boolean)
17
16
  fun coordinatorLayoutDidChangeConfiguration()
18
17
  fun findScrollView(): ScrollView?
@@ -96,11 +95,8 @@ class TrueSheetCoordinatorLayout(context: Context) :
96
95
  * See: https://github.com/facebook/react-native/pull/44099
97
96
  */
98
97
  override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
99
- if (delegate?.isScrollable != true) {
100
- if (ev.actionMasked == MotionEvent.ACTION_DOWN) {
101
- clearStaleNestedScrollingChildRef()
102
- }
103
- return super.onInterceptTouchEvent(ev)
98
+ if (ev.actionMasked == MotionEvent.ACTION_DOWN) {
99
+ clearStaleNestedScrollingChildRef()
104
100
  }
105
101
 
106
102
  val scrollView = delegate?.findScrollView()
@@ -640,7 +640,12 @@ using namespace facebook::react;
640
640
  }
641
641
 
642
642
  - (void)viewControllerDidChangeSize:(CGSize)size {
643
- [self updateStateWithSize: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];
644
649
  }
645
650
 
646
651
  - (void)viewControllerWillFocus {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.9.0-beta.5",
3
+ "version": "3.9.0-beta.6",
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",