closestScrollableElement

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.query

Go up the dom three to find the first element that is scrollable. The default scrollable element is the body

Params

  1. $elm*-HTMLElement

    The element to start on

Return

  1. -HTMLElement|undefined

    The element found or undefined

Example

import { closestScrollableElement } from '@blackbyte/sugar/dom';
closestScrollableElement($myElement);

Todo

  • testsnormal