MCPcopy Create free account
hub / github.com/Noumena-Network/code / scrollBy

Function scrollBy

src/ink/components/ScrollBox.tsx:148–159  ·  view source on GitHub ↗
(dy: number)

Source from the content-addressed store, hash-verified

146 scrollMutated(box);
147 },
148 scrollBy(dy: number) {
149 const el = domRef.current;
150 if (!el) return;
151 el.stickyScroll = false;
152 // Wheel input cancels any in-flight anchor seek — user override.
153 el.scrollAnchor = undefined;
154 // Accumulate in pendingScrollDelta; renderer drains it at a capped
155 // rate so fast flicks show intermediate frames. Pure accumulator:
156 // scroll-up followed by scroll-down naturally cancels.
157 el.pendingScrollDelta = (el.pendingScrollDelta ?? 0) + Math.floor(dy);
158 scrollMutated(el);
159 },
160 scrollToBottom() {
161 const el = domRef.current;
162 if (!el) return;

Callers

nothing calls this directly

Calls 1

scrollMutatedFunction · 0.85

Tested by

no test coverage detected