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

Code before:
    baseEl.style.setProperty('pointer-events', 'none');
    backdropEl.style.setProperty('pointer-events', 'none');

    /**
     * When the backdrop is enabled, elements such
     * as inputs should not be focusable outside
     * the sheet.
     * Adding this class disables focus trapping
     * for the sheet temporarily.
     */
    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]);

Review comment (suggestion):
```suggestion
    const originalFooter = baseEl.querySelector('ion-footer') as HTMLIonFooterElement;
    const clonedFooter = wrapperEl.nextElementSibling as HTMLIonFooterElement;
    const footerToHide = footer === 'original' ? clonedFooter : originalFooter;
    const footerToShow = footer === 'original' ? originalFooter : clonedFooter;
```

Code after:
    baseEl.style.setProperty('pointer-events', 'none');
    backdropEl.style.setProperty('pointer-events', 'none');

    /**
     * When the backdrop is enabled, elements such
     * as inputs should not be focusable outside
     * the sheet.
     * Adding this class disables focus trapping
     * for the sheet temporarily.
     */
    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.
   */