MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / canScrollWithin

Function canScrollWithin

src/Components/Home/home.jsx:143–149  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

141 // when the active screen's own content overflows, let it scroll natively
142 // until it hits the edge — only then do we snap to the next/prev screen
143 const canScrollWithin = (dir) => {
144 const screen = node.firstElementChild?.children[pageIndexRef.current];
145 if (!screen) return false;
146 const {scrollTop, scrollHeight, clientHeight} = screen;
147 if (scrollHeight - clientHeight <= 2) return false;
148 return dir > 0 ? scrollTop + clientHeight < scrollHeight - 2 : scrollTop > 2;
149 };
150 const onWheel = (e) => {
151 if (Math.abs(e.deltaY) < 8) return;
152 if (canScrollWithin(e.deltaY)) return;

Callers 2

onWheelFunction · 0.85
onTouchMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected