Skip to content

Commit ba4fb6f

Browse files
committed
fix(ios): safe area support
1 parent 7e10fe6 commit ba4fb6f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ui-persistent-bottomsheet/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,14 @@ export class PersistentBottomSheet extends GridLayout {
309309
computeTranslationData(height) {
310310
const max = this.translationMaxOffset;
311311
const diff = height - max;
312-
const value = this._translationY;
312+
let value = this._translationY;
313313
const progress = 1 - (this._translationY - diff) / max;
314-
// console.log('computeTranslationData', value, max, diff, progress);
314+
315+
if (global.isIOS && progress === 0 && !this.iosIgnoreSafeArea) {
316+
// if this is the 0 steop ensure it gets hidden even with safeArea
317+
const safeArea = this.getSafeAreaInsets();
318+
value += Utils.layout.toDeviceIndependentPixels(safeArea.bottom);
319+
}
315320
if (this.translationFunction) {
316321
return this.translationFunction(height, value, progress);
317322
}

0 commit comments

Comments
 (0)