Skip to content

Commit a3e9826

Browse files
Fixing enter animation when backdropBreakpoint is greater than currentBreakpoint
1 parent 0b18b6e commit a3e9826

File tree

1 file changed

+6
-3
lines changed
  • core/src/components/modal/animations

1 file changed

+6
-3
lines changed

core/src/components/modal/animations/sheet.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ export const createSheetEnterAnimation = (opts: ModalAnimationOptions) => {
1212
* current breakpoint, then the backdrop should be fading in.
1313
*/
1414
const shouldShowBackdrop = backdropBreakpoint === undefined || backdropBreakpoint < currentBreakpoint!;
15-
const initialBackdrop = shouldShowBackdrop
16-
? `calc(var(--backdrop-opacity) * ${staticBackdropOpacity ? 1 : currentBreakpoint!})`
17-
: '0';
15+
let initialBackdrop = '0';
16+
if (staticBackdropOpacity) {
17+
initialBackdrop = 'calc(var(--backdrop-opacity)';
18+
} else if (shouldShowBackdrop) {
19+
initialBackdrop = `calc(var(--backdrop-opacity) * ${currentBreakpoint!})`;
20+
}
1821

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

0 commit comments

Comments
 (0)