MCPcopy
hub / github.com/ankeetmaini/react-infinite-scroll-component / onStart

Function onStart

src/index.tsx:312–336  ·  view source on GitHub ↗
(evt: Event)

Source from the content-addressed store, hash-verified

310 }
311
312 const onStart = (evt: Event) => {
313 // Only allow pull-to-refresh when the scroll container is at the very top.
314 // Replaces the old lastScrollTop ref which was never updated after removing
315 // the scroll event listener, making the original guard permanently a no-op.
316 const scrollTop =
317 scrollEl instanceof HTMLElement
318 ? scrollEl.scrollTop
319 : document.documentElement.scrollTop;
320 if (scrollTop > 0) return;
321
322 draggingRef.current = true;
323
324 if (evt instanceof MouseEvent) {
325 startYRef.current = evt.pageY;
326 } else if (evt instanceof TouchEvent) {
327 startYRef.current = evt.touches[0].pageY;
328 }
329 currentYRef.current = startYRef.current;
330
331 if (infScrollRef.current) {
332 infScrollRef.current.style.willChange = 'transform';
333 infScrollRef.current.style.transition =
334 'transform 0.2s cubic-bezier(0,0,0.31,1)';
335 }
336 };
337
338 const onMove = (evt: Event) => {
339 if (!draggingRef.current) return;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…