@@ -248,6 +248,10 @@ export default class AnimatedModal<
248248 this . focusFirstInput ( options ?. focusFirstInput ) ;
249249 } , 1 ) ;
250250
251+ const hasModalAnimation =
252+ ( options ?. customAnimation ?. modal ??
253+ this . customHideAnimations ?. modal ) !== undefined ;
254+
251255 const modalAnimation = options ?. customAnimation ?. modal ??
252256 this . customShowAnimations ?. modal ?? {
253257 opacity : [ 0 , 1 ] ,
@@ -269,10 +273,14 @@ export default class AnimatedModal<
269273 : options ?. animationMode ?? "both" ;
270274
271275 if ( animationMode === "both" || animationMode === "none" ) {
272- animate ( this . modalEl , {
273- ...modalAnimation ,
274- duration : animationMode === "none" ? 0 : modalAnimationDuration ,
275- } ) ;
276+ if ( hasModalAnimation ) {
277+ animate ( this . modalEl , {
278+ ...modalAnimation ,
279+ duration : animationMode === "none" ? 0 : modalAnimationDuration ,
280+ } ) ;
281+ } else {
282+ this . modalEl . style . opacity = "1" ;
283+ }
276284
277285 animate ( this . wrapperEl , {
278286 ...wrapperAnimation ,
@@ -322,6 +330,10 @@ export default class AnimatedModal<
322330
323331 await options ?. beforeAnimation ?.( this . modalEl ) ;
324332
333+ const hasModalAnimation =
334+ ( options ?. customAnimation ?. modal ??
335+ this . customHideAnimations ?. modal ) !== undefined ;
336+
325337 const modalAnimation = options ?. customAnimation ?. modal ??
326338 this . customHideAnimations ?. modal ?? {
327339 opacity : [ 1 , 0 ] ,
@@ -351,10 +363,14 @@ export default class AnimatedModal<
351363 : options ?. animationMode ?? "both" ;
352364
353365 if ( animationMode === "both" || animationMode === "none" ) {
354- animate ( this . modalEl , {
355- ...modalAnimation ,
356- duration : animationMode === "none" ? 0 : modalAnimationDuration ,
357- } ) ;
366+ if ( hasModalAnimation ) {
367+ animate ( this . modalEl , {
368+ ...modalAnimation ,
369+ duration : animationMode === "none" ? 0 : modalAnimationDuration ,
370+ } ) ;
371+ } else {
372+ this . modalEl . style . opacity = "1" ;
373+ }
358374
359375 animate ( this . wrapperEl , {
360376 ...wrapperAnimation ,
0 commit comments