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

Function scrollTo

packages/react-select/src/utils.ts:187–195  ·  view source on GitHub ↗
(el: HTMLElement | typeof window, top: number)

Source from the content-addressed store, hash-verified

185}
186
187export function scrollTo(el: HTMLElement | typeof window, top: number): void {
188 // with a scroll distance, we perform scroll on the element
189 if (isDocumentElement(el)) {
190 window.scrollTo(0, top);
191 return;
192 }
193
194 el.scrollTop = top;
195}
196
197// Get Scroll Parent
198// ------------------------------

Callers 3

getMenuPlacementFunction · 0.90
animateScrollFunction · 0.85
scrollIntoViewFunction · 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…