UNPKG

@planjs/utils

Version:

🔧 Common tools collection

13 lines (12 loc) • 413 B
/** * Determines if the passed element is overflowing its bounds * @param el */ function checkOverflow(el) { var curOverflow = el.style.overflow; if (!curOverflow || curOverflow === 'visible') el.style.overflow = 'hidden'; var isOverflowing = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight; el.style.overflow = curOverflow; return isOverflowing; } export default checkOverflow;