Skip to content

Commit 396bf73

Browse files
committed
fix: footerAnimation did not exist at gestures initialization.
1 parent ad90cd9 commit 396bf73

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

core/src/components/modal/animations/ios.enter.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ export const iosEnterAnimation = (baseEl: HTMLElement, opts: ModalAnimationOptio
4141
.duration(500)
4242
.addAnimation([wrapperAnimation])
4343
.beforeAddWrite(() => {
44+
if (!animateContentHeight) return;
45+
4446
const ionFooter = baseEl.querySelector('ion-footer');
45-
if (ionFooter) {
47+
if (ionFooter && footerAnimation) {
4648
const footerHeight = ionFooter.clientHeight;
4749
const clonedFooter = ionFooter.cloneNode(true) as HTMLElement;
4850
baseEl.shadowRoot!.appendChild(clonedFooter);
@@ -52,16 +54,18 @@ export const iosEnterAnimation = (baseEl: HTMLElement, opts: ModalAnimationOptio
5254
// the same as the cloned footer height
5355
const page = baseEl.querySelector('.ion-page') as HTMLElement;
5456
page.style.setProperty('padding-bottom', `${footerHeight}px`);
55-
if (animateContentHeight && footerAnimation) {
5657
footerAnimation.addElement(root.querySelector('ion-footer')!);
57-
baseAnimation.addAnimation(footerAnimation);
58-
}
59-
}});
58+
}
59+
});
6060

6161
if (animateContentHeight && contentAnimation) {
6262
baseAnimation.addAnimation(contentAnimation);
6363
}
6464

65+
if (animateContentHeight && footerAnimation) {
66+
baseAnimation.addAnimation(footerAnimation);
67+
}
68+
6569
if (presentingEl) {
6670
const isMobile = window.innerWidth < 768;
6771
const hasCardModal =

core/src/components/modal/animations/md.enter.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ export const mdEnterAnimation = (baseEl: HTMLElement, opts: ModalAnimationOption
4343
.duration(280)
4444
.addAnimation([backdropAnimation, wrapperAnimation])
4545
.beforeAddWrite(() => {
46+
if (!animateContentHeight) return;
47+
4648
const ionFooter = baseEl.querySelector('ion-footer');
47-
if (ionFooter) {
49+
if (ionFooter && footerAnimation) {
4850
const footerHeight = ionFooter.clientHeight;
4951
const clonedFooter = ionFooter.cloneNode(true) as HTMLElement;
5052
baseEl.shadowRoot!.appendChild(clonedFooter);
@@ -54,15 +56,17 @@ export const mdEnterAnimation = (baseEl: HTMLElement, opts: ModalAnimationOption
5456
// the same as the cloned footer height
5557
const page = baseEl.querySelector('.ion-page') as HTMLElement;
5658
page.style.setProperty('padding-bottom', `${footerHeight}px`);
57-
if (animateContentHeight && footerAnimation) {
5859
footerAnimation.addElement(root.querySelector('ion-footer')!);
59-
baseAnimation.addAnimation(footerAnimation);
60-
}
61-
}});
60+
}
61+
});
6262

6363
if (animateContentHeight && contentAnimation) {
6464
baseAnimation.addAnimation(contentAnimation);
6565
}
6666

67+
if (animateContentHeight && footerAnimation) {
68+
baseAnimation.addAnimation(footerAnimation);
69+
}
70+
6771
return baseAnimation;
6872
};

0 commit comments

Comments
 (0)