MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / hasHorizScrollbar

Function hasHorizScrollbar

packages/@stdlib/misc/src/dom.ts:12–20  ·  view source on GitHub ↗
(elem: HTMLElement)

Source from the content-addressed store, hash-verified

10 );
11}
12export 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
22export function hasScrollbar(elem: HTMLElement) {
23 return hasHorizScrollbar(elem) || hasVertScrollbar(elem);

Callers 3

hasScrollbarFunction · 0.85
isTouchOverScrollbarFunction · 0.85
isMouseOverScrollbarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected