Skip to content
Merged
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
9 changes: 6 additions & 3 deletions core/src/components/modal/animations/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ export const createSheetEnterAnimation = (opts: ModalAnimationOptions) => {
* current breakpoint, then the backdrop should be fading in.
*/
const shouldShowBackdrop = backdropBreakpoint === undefined || backdropBreakpoint < currentBreakpoint!;
const initialBackdrop = shouldShowBackdrop
? `calc(var(--backdrop-opacity) * ${staticBackdropOpacity ? 1 : currentBreakpoint!})`
: '0';
let initialBackdrop = '0';
if (staticBackdropOpacity) {
initialBackdrop = 'calc(var(--backdrop-opacity)';
} else if (shouldShowBackdrop) {
initialBackdrop = `calc(var(--backdrop-opacity) * ${currentBreakpoint!})`;
}

const backdropAnimation = createAnimation('backdropAnimation').fromTo('opacity', 0, initialBackdrop);

Expand Down
2 changes: 2 additions & 0 deletions core/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,8 @@ interface ModalOverlayOptions {
/**
* The point after which the backdrop will begin
* to fade in when using a sheet modal.
* This option is ignored for the ionic theme
* due to the option below.
*/
backdropBreakpoint: number;
/**
Expand Down
Loading