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

Function scrollTo

src/ink/components/ScrollBox.tsx:126–136  ·  view source on GitHub ↗
(y: number)

Source from the content-addressed store, hash-verified

124 }
125 useImperativeHandle(ref, (): ScrollBoxHandle => ({
126 scrollTo(y: number) {
127 const el = domRef.current;
128 if (!el) return;
129 // Explicit false overrides the DOM attribute so manual scroll
130 // breaks stickiness. Render code checks ?? precedence.
131 el.stickyScroll = false;
132 el.pendingScrollDelta = undefined;
133 el.scrollAnchor = undefined;
134 el.scrollTop = Math.max(0, Math.floor(y));
135 scrollMutated(el);
136 },
137 scrollToElement(el: DOMElement, offset = 0) {
138 const box = domRef.current;
139 if (!box) return;

Callers

nothing calls this directly

Calls 2

scrollMutatedFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected