Skip to content

Commit fb52d51

Browse files
committed
chore: refactoring
1 parent ba4fb6f commit fb52d51

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ui-persistent-bottomsheet/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,17 @@ export class PersistentBottomSheet extends GridLayout {
143143
if (this.steps.length === 0 || (this.steps.length === 1 && this.steps[0] === 0)) {
144144
return false;
145145
}
146-
const safeAreatop = Utils.layout.toDeviceIndependentPixels(this.getSafeAreaInsets().top);
147-
const y = data.y - safeAreatop;
146+
let deltaY = 0;
147+
if (global.isIOS && !this.iosIgnoreSafeArea) {
148+
deltaY -= Utils.layout.toDeviceIndependentPixels(this.getSafeAreaInsets().top);
149+
}
150+
const y = data.y + deltaY;
148151
// console.log('shouldStartGesture ', safeAreatop, data, y, this.viewHeight - (this.translationMaxOffset - this.translationY), this.translationY, this.translationMaxOffset, this.viewHeight);
149152
if (y < this.viewHeight - (this.bottomViewHeight - this.translationY)) {
150153
return false;
151154
}
152155
if (this._scrollView) {
153-
const posY = this._scrollView && this.scrollView.getLocationRelativeTo(this).y - safeAreatop;
156+
const posY = this._scrollView && this.scrollView.getLocationRelativeTo(this).y + deltaY;
154157
if (y >= posY && y <= posY + this.scrollView.getMeasuredHeight()) {
155158
return false;
156159
}

0 commit comments

Comments
 (0)