Skip to content

Commit 962de0d

Browse files
authored
fix(ios): clear stale ScrollView reference when content changes (#482)
Fixes #481
1 parent 064f0d5 commit 962de0d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### 🐛 Bug fixes
6+
7+
- **iOS**: Fixed content clipping when sheet content changes dynamically by clearing stale ScrollView reference. ([#482](https://github.com/lodev09/react-native-true-sheet/pull/482) by [@sbs44](https://github.com/sbs44))
8+
59
## 3.8.1
610

711
### 📖 Documentation

ios/TrueSheetContentView.mm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ - (void)setupScrollable:(BOOL)enabled bottomInset:(CGFloat)bottomInset {
9393
return;
9494
}
9595

96-
// Already set up with same inset
96+
// Check if pinned scroll view is still valid (still in view hierarchy)
97+
// This handles the case where content changes and the old scroll view is unmounted
98+
if (_pinnedScrollView && ![_pinnedScrollView isDescendantOfView:self]) {
99+
[self clearScrollable];
100+
}
101+
102+
// Already set up with same inset and valid scroll view
97103
if (_pinnedScrollView && _bottomInset == bottomInset) {
98104
return;
99105
}

0 commit comments

Comments
 (0)