Skip to content

Commit 5fd5130

Browse files
committed
feat(sheet): use push effect even if no safe areas detected
1 parent da356cb commit 5fd5130

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/core/components/sheet/sheet-class.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -466,18 +466,18 @@ class Sheet extends Modal {
466466
if (sheet.push) {
467467
pushOffset = parseInt($el.css('--f7-sheet-push-offset'), 10);
468468
if (Number.isNaN(pushOffset)) pushOffset = 0;
469-
if (pushOffset) {
470-
$el.addClass('sheet-modal-push');
471-
sheet.$htmlEl.addClass('with-modal-sheet-push');
472-
if (!sheet.params.swipeToStep) {
473-
sheet.$htmlEl[0].style.setProperty('--f7-sheet-push-scale', pushViewScale(pushOffset));
474-
} else {
475-
$pushViewEl = app.$el.children('.view, .views');
476-
pushBorderRadius = parseFloat(
477-
$el.css(`border-${isTopSheetModal ? 'bottom' : 'top'}-left-radius`),
478-
);
479-
$pushViewEl.css('border-radius', '0px');
480-
}
469+
if (!pushOffset) pushOffset = app.theme === 'ios' ? 44 : 48;
470+
sheet.$htmlEl[0].style.setProperty('--f7-sheet-push-offset', `${pushOffset}px`);
471+
$el.addClass('sheet-modal-push');
472+
sheet.$htmlEl.addClass('with-modal-sheet-push');
473+
if (!sheet.params.swipeToStep) {
474+
sheet.$htmlEl[0].style.setProperty('--f7-sheet-push-scale', pushViewScale(pushOffset));
475+
} else {
476+
$pushViewEl = app.$el.children('.view, .views');
477+
pushBorderRadius = parseFloat(
478+
$el.css(`border-${isTopSheetModal ? 'bottom' : 'top'}-left-radius`),
479+
);
480+
$pushViewEl.css('border-radius', '0px');
481481
}
482482
}
483483
});
@@ -532,6 +532,7 @@ class Sheet extends Modal {
532532
sheet.emit('local::_swipeStep', true);
533533
if (sheet.push) {
534534
sheet.$htmlEl[0].style.removeProperty('--f7-sheet-push-scale');
535+
sheet.$htmlEl[0].style.removeProperty('--f7-sheet-push-offset');
535536
}
536537
};
537538
sheet.stepToggle = function stepToggle() {

0 commit comments

Comments
 (0)