Repository: ionic-team/ionic-framework
File: core/src/components/modal/gestures/sheet.ts (TypeScript)

Code before:
     */
    baseEl.classList.add(FOCUS_TRAP_DISABLE_CLASS);
  };


  /**
   * Used when `scrollAtEdge` is disabled.
   * Changes the footer that is currently visible
   * @param footer - The footer to show
   */
  const swapFooterVisibility = (footer: 'original' | 'cloned') => {
    const footerToHide = footer === 'original' ?
      wrapperEl.nextElementSibling as HTMLIonFooterElement :
      baseEl.querySelector('ion-footer') as HTMLIonFooterElement;
    const footerToShow = footer === 'original' ?
      baseEl.querySelector('ion-footer') as HTMLIonFooterElement :
      wrapperEl.nextElementSibling as HTMLIonFooterElement;

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

    const pagePadding =
      footer === 'original' ? 0 : footerToShow.clientHeight;

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

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

  /**
   * After the entering animation completes,
   * we need to set the animation to go from
   * offset 0 to offset 1 so that users can
   * swipe in any direction. We then set the
   * animation offset to the current breakpoint
   * so there is no flickering.
   */
  if (wrapperAnimation && backdropAnimation) {
    wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
    backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
    contentAnimation?.keyframes([...SheetDefaults.CONTENT_KEYFRAMES]);
    animation.progressStart(true, 1 - currentBreakpoint);

    /**
     * If backdrop is not enabled, then content
     * behind modal should be clickable. To do this, we need
     * to remove pointer-events from ion-modal as a whole.
     * ion-backdrop and .modal-wrapper always have pointer-events: auto
     * applied, so the modal content can still be interacted with.

Review comment (suggestion):
```suggestion
    if (footer === 'original') {
      page.style.removeProperty('padding-bottom');
    } else {
      const pagePadding = footerToShow.clientHeight;
      page.style.setProperty('padding-bottom', `${pagePadding}px`);
    }
```

Since we added the inline padding bottom, then we can safely remove it so it reverts to the original inline styles.

Code after:
     */
    baseEl.classList.add(FOCUS_TRAP_DISABLE_CLASS);
  };

  /**
   * Toggles the visible modal footer when `expandToScroll` is disabled.
   * @param footer The footer to show.
   */
  const swapFooterVisibility = (footer: 'original' | 'cloned') => {
    const originalFooter = baseEl.querySelector('ion-footer') as HTMLIonFooterElement | null;

    if (!originalFooter) {
      return;
    }

    const clonedFooter = wrapperEl.nextElementSibling as HTMLIonFooterElement;
    const footerToHide = footer === 'original' ? clonedFooter : originalFooter;
    const footerToShow = footer === 'original' ? originalFooter : clonedFooter;

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

    const page = baseEl.querySelector('.ion-page') as HTMLElement;
    if (footer === 'original') {
      page.style.removeProperty('padding-bottom');
    } else {
      const pagePadding = footerToShow.clientHeight;
      page.style.setProperty('padding-bottom', `${pagePadding}px`);
    }

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

  /**
   * After the entering animation completes,
   * we need to set the animation to go from
   * offset 0 to offset 1 so that users can
   * swipe in any direction. We then set the
   * animation offset to the current breakpoint
   * so there is no flickering.
   */
  if (wrapperAnimation && backdropAnimation) {
    wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
    backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
    contentAnimation?.keyframes([...SheetDefaults.CONTENT_KEYFRAMES]);
    animation.progressStart(true, 1 - currentBreakpoint);

    /**
     * If backdrop is not enabled, then content
     * behind modal should be clickable. To do this, we need