Repository: ionic-team/ionic-framework
File: core/src/components/modal/animations/ios.leave.ts (TypeScript)

Code before:
    .duration(duration)
    .addAnimation(wrapperAnimation)
    .beforeAddWrite(() => {
      if (scrollAtEdge) {
        // Scroll can only be done when the modal is fully expanded.
        return;
      }

      /**
       * If scrollAtEdge is disabled, we need toß swap
       * the visibility to the original, so the footer
       *  dismisses with the modal and doesn't stay
       *  until the modal is removed from the DOM.
       */
      const ionFooter = baseEl.querySelector('ion-footer');
      if (ionFooter) {
        const clonedFooter = baseEl.shadowRoot!.querySelector('ion-footer')!;

        ionFooter.style.removeProperty('display');
        ionFooter.removeAttribute('aria-hidden');

        clonedFooter.style.setProperty('display', 'none');
        clonedFooter.setAttribute('aria-hidden', 'true');

        const page = baseEl.querySelector('.ion-page') as HTMLElement;
        page.style.setProperty('padding-bottom', `0`);
      }
    });

  if (presentingEl) {
    const isMobile = window.innerWidth < 768;
    const hasCardModal =
      presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined;
    const presentingElRoot = getElementRoot(presentingEl);

    const presentingAnimation = createAnimation()
      .beforeClearStyles(['transform'])
      .afterClearStyles(['transform'])
      .onFinish((currentStep) => {
        // only reset background color if this is the last card-style modal
        if (currentStep !== 1) {
          return;
        }

        presentingEl.style.setProperty('overflow', '');

        const numModals = (
          Array.from(bodyEl.querySelectorAll('ion-modal:not(.overlay-hidden)')) as HTMLIonModalElement[]
        ).filter((m) => m.presentingElement !== undefined).length;
        if (numModals <= 1) {
          bodyEl.style.setProperty('background-color', '');

Review comment (suggestion):
```suggestion
        page.style.removeProperty('padding-bottom');
```
Since we added the inline padding bottom, then we can safely remove it so it reverts to the original inline styles.

Code after:
    .duration(duration)
    .addAnimation(wrapperAnimation)
    .beforeAddWrite(() => {
      if (expandToScroll) {
        // Scroll can only be done when the modal is fully expanded.
        return;
      }

      /**
       * If expandToScroll is disabled, we need to swap
       * the visibility to the original, so the footer
       * dismisses with the modal and doesn't stay
       * until the modal is removed from the DOM.
       */
      const ionFooter = baseEl.querySelector('ion-footer');
      if (ionFooter) {
        const clonedFooter = baseEl.shadowRoot!.querySelector('ion-footer')!;

        ionFooter.style.removeProperty('display');
        ionFooter.removeAttribute('aria-hidden');

        clonedFooter.style.setProperty('display', 'none');
        clonedFooter.setAttribute('aria-hidden', 'true');

        const page = baseEl.querySelector('.ion-page') as HTMLElement;
        page.style.removeProperty('padding-bottom');
      }
    });

  if (presentingEl) {
    const isMobile = window.innerWidth < 768;
    const hasCardModal =
      presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined;
    const presentingElRoot = getElementRoot(presentingEl);

    const presentingAnimation = createAnimation()
      .beforeClearStyles(['transform'])
      .afterClearStyles(['transform'])
      .onFinish((currentStep) => {
        // only reset background color if this is the last card-style modal
        if (currentStep !== 1) {
          return;
        }

        presentingEl.style.setProperty('overflow', '');

        const numModals = (
          Array.from(bodyEl.querySelectorAll('ion-modal:not(.overlay-hidden)')) as HTMLIonModalElement[]
        ).filter((m) => m.presentingElement !== undefined).length;
        if (numModals <= 1) {
          bodyEl.style.setProperty('background-color', '');