MCPcopy
hub / github.com/JedWatson/react-select / getScrollTop

Function getScrollTop

packages/react-select/src/utils.ts:180–185  ·  view source on GitHub ↗
(el: HTMLElement | typeof window)

Source from the content-addressed store, hash-verified

178// ------------------------------
179
180export function getScrollTop(el: HTMLElement | typeof window): number {
181 if (isDocumentElement(el)) {
182 return window.pageYOffset;
183 }
184 return el.scrollTop;
185}
186
187export function scrollTo(el: HTMLElement | typeof window, top: number): void {
188 // with a scroll distance, we perform scroll on the element

Callers 2

getMenuPlacementFunction · 0.90
animatedScrollToFunction · 0.85

Calls 1

isDocumentElementFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…