src/Draggable/Plugins/Scrollable/Scrollable.js
function closestScrollableElement(element) {
  if (!element) {
    return getDocumentScrollingElement();
  }

  const position = getComputedStyle(element).getPropertyValue('position');
  const excludeStaticParents = position === 'absolute';

  const scrollableElement = closest(element, (parent) => {
    if (excludeStaticParents && isStaticallyPositioned(parent)) {
      return false;
    }
    return hasOverflow(parent);
  });

  if (position === 'fixed' || !scrollableElement) {
    return getDocumentScrollingElement();
  } else {
    return scrollableElement;
  }
}
function closestScrollableElement(element) {
  if (!element) {
    return getDocumentScrollingElement();
  }

  const position = getComputedStyle(element).getPropertyValue('position');
  const excludeStaticParents = position === 'absolute';

  const scrollableElement = closest(element, (parent) => {
    if (excludeStaticParents && isStaticallyPositioned(parent)) {
      return false;
    }
    return hasOverflow(parent);
  });

  if (position === 'fixed' || !scrollableElement) {
    return getDocumentScrollingElement();
  } else {
    return scrollableElement;
  }
}
function closestScrollableElement ( element ) { if ( ! element ) { return getDocumentScrollingElement ( ) ; } const position = getComputedStyle ( element ) . getPropertyValue ( 'position' ) ; const excludeStaticParents = position === 'absolute' ; const scrollableElement = closest ( element , ( parent ) => { if ( excludeStaticParents && isStaticallyPositioned ( parent ) ) { return false ; } return hasOverflow ( parent ) ; } ) ; if ( position === 'fixed' || ! scrollableElement ) { return getDocumentScrollingElement ( ) ; } else { return scrollableElement ; } }
Finds closest scrollable element
@param {HTMLElement} element
@return {HTMLElement}
@private
Finds closest scrollable element