Skip to content
Merged
Changes from 1 commit
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
Loading