MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / onscrollV

Function onscrollV

src/lib/editorManager.js:2517–2530  ·  view source on GitHub ↗

* Sets the vertical scroll value of the editor. This is called when the editor is scrolled horizontally using the scrollbar. * @param {Number} value

(value)

Source from the content-addressed store, hash-verified

2515 * @param {Number} value
2516 */
2517 function onscrollV(value) {
2518 const scroller = editor?.scrollDOM;
2519 if (!scroller) return;
2520 suppressCursorReveal();
2521 const normalized = clamp01(value);
2522 const maxScroll = Math.max(
2523 scroller.scrollHeight - scroller.clientHeight,
2524 0,
2525 );
2526 preventScrollbarV = true;
2527 scroller.scrollTop = normalized * maxScroll;
2528 lastScrollTop = scroller.scrollTop;
2529 lockScrollbarScrollPosition({ top: lastScrollTop });
2530 }
2531
2532 /**
2533 * Handles the onscroll event for the vend element.

Callers

nothing calls this directly

Calls 3

suppressCursorRevealFunction · 0.85
clamp01Function · 0.85

Tested by

no test coverage detected