@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 +2 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +5 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +0 -1
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +2 -6
- package/ios/TrueSheetView.mm +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/lodev09/react-native-true-sheet/actions/workflows/checks.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@lodev09/react-native-true-sheet)
|
|
5
|
+
[](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.
|
|
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
|
-
|
|
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 (
|
|
100
|
-
|
|
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()
|
package/ios/TrueSheetView.mm
CHANGED
|
@@ -640,7 +640,12 @@ using namespace facebook::react;
|
|
|
640
640
|
}
|
|
641
641
|
|
|
642
642
|
- (void)viewControllerDidChangeSize:(CGSize)size {
|
|
643
|
-
|
|
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