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

Code before:
  if (contentEl && currentBreakpoint !== maxBreakpoint) {
    contentEl.scrollY = false;
  }

  const canStart = (detail: GestureDetail) => {
    /**
     * If the sheet is fully expanded and
     * the user is swiping on the content,
     * the gesture should not start to
     * allow for scrolling on the content.
     */
    const content = (detail.event.target! as HTMLElement).closest('ion-content');

    if (currentBreakpoint === 1 && content) {
      return false;
    }

    /* tslint:disable-next-line */
    if (typeof document !== 'undefined') {
      const activeElement = baseEl.ownerDocument.activeElement as HTMLElement;
      if (activeElement.matches('input,ion-input,textarea,ion-textarea')) {
        // Dismisses the open keyboard when the sheet drag gesture is started.
        activeElement.blur();
      }
    }

    return true;
  };

  const onStart = () => {
    /**
     * If swiping on the content
     * we should disable scrolling otherwise
     * the sheet will expand and the content will scroll.
     */
    if (contentEl) {
      contentEl.scrollY = false;
    }

    animation.progressStart(true, 1 - currentBreakpoint);
  };

  const onMove = (detail: GestureDetail) => {
    /**
     * Given the change in gesture position on the Y axis,
     * compute where the offset of the animation should be
     * relative to where the user dragged.
     */
    const initialStep = 1 - currentBreakpoint;
    offset = clamp(0.0001, initialStep + (detail.deltaY / height), 0.9999);
    animation.progressStep(offset);

Review comment (suggestion):
Putting this in `canStart` feels a little weird; it seems like it should go in `onStart` or somewhere else that more explicitly indicates that we're starting a gesture.

Code after:
  if (contentEl && currentBreakpoint !== maxBreakpoint) {
    contentEl.scrollY = false;
  }

  const canStart = (detail: GestureDetail) => {
    /**
     * If the sheet is fully expanded and
     * the user is swiping on the content,
     * the gesture should not start to
     * allow for scrolling on the content.
     */
    const content = (detail.event.target! as HTMLElement).closest('ion-content');

    if (currentBreakpoint === 1 && content) {
      return false;
    }

    return true;
  };

  const onStart = () => {
    /**
     * If swiping on the content
     * we should disable scrolling otherwise
     * the sheet will expand and the content will scroll.
     */
    if (contentEl) {
      contentEl.scrollY = false;
    }

    /* tslint:disable-next-line */
    if (typeof document !== 'undefined') {
      const activeElement = baseEl.ownerDocument.activeElement as HTMLElement;
      if (activeElement.matches('input,ion-input,textarea,ion-textarea')) {
        raf(() => {
          // Dismisses the open keyboard when the sheet drag gesture is started.
          activeElement.blur();
        });
      }
    }

    animation.progressStart(true, 1 - currentBreakpoint);
  };

  const onMove = (detail: GestureDetail) => {
    /**
     * Given the change in gesture position on the Y axis,
     * compute where the offset of the animation should be
     * relative to where the user dragged.
     */
    const initialStep = 1 - currentBreakpoint;