@@ -19,25 +19,33 @@ const createEnterAnimation = () => {
1919 { offset : 1 , opacity : 1 , transform : `translateY(0px)` } ,
2020 ] ) ;
2121
22- return { backdropAnimation, wrapperAnimation } ;
22+ return { backdropAnimation, wrapperAnimation, contentAnimation : undefined } ;
2323} ;
2424
2525/**
2626 * Md Modal Enter Animation
2727 */
2828export const mdEnterAnimation = ( baseEl : HTMLElement , opts : ModalAnimationOptions ) : Animation => {
29- const { currentBreakpoint } = opts ;
29+ const { currentBreakpoint, animateContentHeight } = opts ;
3030 const root = getElementRoot ( baseEl ) ;
31- const { wrapperAnimation, backdropAnimation } =
31+ const { wrapperAnimation, backdropAnimation, contentAnimation } =
3232 currentBreakpoint !== undefined ? createSheetEnterAnimation ( opts ) : createEnterAnimation ( ) ;
3333
3434 backdropAnimation . addElement ( root . querySelector ( 'ion-backdrop' ) ! ) ;
3535
3636 wrapperAnimation . addElement ( root . querySelector ( '.modal-wrapper' ) ! ) ;
3737
38- return createAnimation ( )
39- . addElement ( baseEl )
40- . easing ( 'cubic-bezier(0.36,0.66,0.04,1)' )
41- . duration ( 280 )
42- . addAnimation ( [ backdropAnimation , wrapperAnimation ] ) ;
38+ contentAnimation ?. addElement ( baseEl . querySelector ( '.ion-page' ) ! ) ;
39+
40+ const baseAnimation = createAnimation ( )
41+ . addElement ( baseEl )
42+ . easing ( 'cubic-bezier(0.36,0.66,0.04,1)' )
43+ . duration ( 280 )
44+ . addAnimation ( [ backdropAnimation , wrapperAnimation ] ) ;
45+
46+ if ( contentAnimation && animateContentHeight ) {
47+ baseAnimation . addAnimation ( contentAnimation ) ;
48+ }
49+
50+ return baseAnimation ;
4351} ;
0 commit comments