/**
* @module hasScrollbar
* @description Test if an HTMLElement has either vertical and horizontal scrollbars.
*
* @since 1.0.0
*
* @param {HTMLElement} el The element to check against.
*
* @return {object} An object containing booleans for vertical and horizontal scrollbar existence.
*
* @example
* import { getNodes, hasScrollbar } from "@gravityforms/utils";
*
* function Example() {
* const node = getNodes( 'example' )[ 0 ];
* const scrollInfo = hasScrollbar( node );
* if ( scrollInfo.vertical || scrollInfo.horizontal ) {
* //do something
* }
* }
*
*/
export default function hasScrollbar( el ) {
return {
vertical: el.scrollHeight > el.clientHeight,
horizontal: el.scrollWidth > el.clientWidth,
};
}