@lodev09/react-native-true-sheet 4.0.0-beta.27 → 4.0.0-beta.28
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.
|
@@ -77,6 +77,9 @@ static char TrueSheetAccessibilityWindowPreviousElementsKey;
|
|
|
77
77
|
@implementation TrueSheetViewController {
|
|
78
78
|
TrueSheetPositionState _lastEmittedPositionState;
|
|
79
79
|
CGSize _lastReportedSize;
|
|
80
|
+
// Net of the footer's baked-in inset, snapshotted together: the inset updates
|
|
81
|
+
// with the footer's layout, but a size change mid-present is deferred to
|
|
82
|
+
// didPresent, so subtracting it live pairs a new inset with a stale height.
|
|
80
83
|
CGFloat _autoDetentHeight;
|
|
81
84
|
CGFloat _peekDetentHeight;
|
|
82
85
|
NSInteger _pendingDetentIndex;
|
|
@@ -1576,8 +1579,8 @@ static BOOL TrueSheetIsPhoneIdiom(void) {
|
|
|
1576
1579
|
*/
|
|
1577
1580
|
- (void)setupSheetDetentsForSizeChange {
|
|
1578
1581
|
if (@available(iOS 16.0, *)) {
|
|
1579
|
-
CGFloat autoHeight = [_detentCalculator autoHeightForKeyboardHeight:_keyboardHeight];
|
|
1580
|
-
CGFloat peekHeight = [_detentCalculator peekHeight];
|
|
1582
|
+
CGFloat autoHeight = [_detentCalculator autoHeightForKeyboardHeight:_keyboardHeight] - [self autoDetentBottomInset];
|
|
1583
|
+
CGFloat peekHeight = [_detentCalculator peekHeight] - [self peekDetentBottomInset];
|
|
1581
1584
|
|
|
1582
1585
|
if (fabs(autoHeight - _autoDetentHeight) < 0.5 && fabs(peekHeight - _peekDetentHeight) < 0.5) {
|
|
1583
1586
|
return;
|
|
@@ -1617,8 +1620,8 @@ static BOOL TrueSheetIsPhoneIdiom(void) {
|
|
|
1617
1620
|
[_detentCalculator clearResolvedHeights];
|
|
1618
1621
|
_hingeCorrections = 0;
|
|
1619
1622
|
|
|
1620
|
-
_autoDetentHeight = [_detentCalculator autoHeightForKeyboardHeight:_keyboardHeight];
|
|
1621
|
-
_peekDetentHeight = [_detentCalculator peekHeight];
|
|
1623
|
+
_autoDetentHeight = [_detentCalculator autoHeightForKeyboardHeight:_keyboardHeight] - [self autoDetentBottomInset];
|
|
1624
|
+
_peekDetentHeight = [_detentCalculator peekHeight] - [self peekDetentBottomInset];
|
|
1622
1625
|
|
|
1623
1626
|
for (NSInteger index = 0; index < self.detents.count; index++) {
|
|
1624
1627
|
id detent = self.detents[index];
|
|
@@ -1681,7 +1684,7 @@ static BOOL TrueSheetIsPhoneIdiom(void) {
|
|
|
1681
1684
|
return [self customDetentWithIdentifier:@"custom-auto"
|
|
1682
1685
|
atIndex:index
|
|
1683
1686
|
heightBlock:^CGFloat {
|
|
1684
|
-
return self->_autoDetentHeight
|
|
1687
|
+
return self->_autoDetentHeight;
|
|
1685
1688
|
}];
|
|
1686
1689
|
} else {
|
|
1687
1690
|
return [UISheetPresentationControllerDetent mediumDetent];
|
|
@@ -1693,7 +1696,7 @@ static BOOL TrueSheetIsPhoneIdiom(void) {
|
|
|
1693
1696
|
return [self customDetentWithIdentifier:@"custom-peek"
|
|
1694
1697
|
atIndex:index
|
|
1695
1698
|
heightBlock:^CGFloat {
|
|
1696
|
-
return self->_peekDetentHeight
|
|
1699
|
+
return self->_peekDetentHeight;
|
|
1697
1700
|
}];
|
|
1698
1701
|
} else {
|
|
1699
1702
|
return [UISheetPresentationControllerDetent mediumDetent];
|
package/package.json
CHANGED