MCPcopy Index your code
hub / github.com/primer/react / isScrollable

Function isScrollable

packages/react/src/utils/scroll.ts:14–18  ·  view source on GitHub ↗

Returns `true` if the element is scrollable

(element: Element)

Source from the content-addressed store, hash-verified

12
13/** Returns `true` if the element is scrollable */
14function isScrollable(element: Element) {
15 const hasScrollableContent = element.scrollHeight > element.clientHeight
16
17 return hasScrollableContent && !(window.getComputedStyle(element).overflowY.indexOf('hidden') !== -1)
18}

Callers 1

getScrollContainerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected