Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### 🐛 Bug fixes

- **iOS**: Fixed footer ignoring safe area insets by pinning to `safeAreaLayoutGuide.bottomAnchor` instead of `bottomAnchor`. ([#644](https://github.com/lodev09/react-native-true-sheet/pull/644) by [@isaacrowntree](https://github.com/isaacrowntree))
- **Android**: Fixed footer rendering behind the navigation/gesture bar by accounting for `bottomInset` in `positionFooter`. ([#644](https://github.com/lodev09/react-native-true-sheet/pull/644) by [@isaacrowntree](https://github.com/isaacrowntree))

## 3.10.0

### 🎉 New features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,10 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
val sheetHeight = sheet.height
val sheetTop = sheet.top

var footerY = (sheetHeight - sheetTop - footerHeight - currentKeyboardInset).toFloat()
// Subtract bottomInset so footer content doesn't render behind the navigation/gesture bar.
// When the keyboard is visible, currentKeyboardInset already accounts for the bottom inset.
val safeAreaOffset = if (currentKeyboardInset > 0) 0 else bottomInset
var footerY = (sheetHeight - sheetTop - footerHeight - currentKeyboardInset - safeAreaOffset).toFloat()

// Adjust during dismiss animation when slideOffset is negative
if (slideOffset != null && slideOffset < 0) {
Expand Down
4 changes: 3 additions & 1 deletion ios/TrueSheetFooterView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ - (void)setupConstraintsWithHeight:(CGFloat)height {
[self.leadingAnchor constraintEqualToAnchor:parentView.leadingAnchor].active = YES;
[self.trailingAnchor constraintEqualToAnchor:parentView.trailingAnchor].active = YES;

_bottomConstraint = [self.bottomAnchor constraintEqualToAnchor:parentView.bottomAnchor
// Pin to safe area so footer content doesn't render behind the home indicator.
// When the keyboard is visible, its height already includes the safe area inset.
_bottomConstraint = [self.bottomAnchor constraintEqualToAnchor:parentView.safeAreaLayoutGuide.bottomAnchor
constant:-_currentKeyboardOffset];
_bottomConstraint.active = YES;

Expand Down
Loading