(elem: HTMLElement)
| 10 | ); |
| 11 | } |
| 12 | export function hasHorizScrollbar(elem: HTMLElement) { |
| 13 | const computedStyle = window.getComputedStyle(elem); |
| 14 | |
| 15 | return ( |
| 16 | computedStyle.overflowX === 'scroll' || |
| 17 | (computedStyle.overflowX === 'auto' && |
| 18 | elem.scrollWidth > (elem.clientWidth || elem.offsetWidth)) |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | export function hasScrollbar(elem: HTMLElement) { |
| 23 | return hasHorizScrollbar(elem) || hasVertScrollbar(elem); |
no outgoing calls
no test coverage detected