MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / isNearScrollBottom

Function isNearScrollBottom

src/hold-stream.ts:88–93  ·  view source on GitHub ↗
(
  el: HTMLElement,
  thresholdPx = 24,
)

Source from the content-addressed store, hash-verified

86
87/** True when the reader is within thresholdPx of the bottom edge. */
88export function isNearScrollBottom(
89 el: HTMLElement,
90 thresholdPx = 24,
91): boolean {
92 return el.scrollHeight - el.scrollTop - el.clientHeight <= thresholdPx;
93}
94
95/** Default distance from bottom that re-enables stream follow. */
96export const DEFAULT_STREAM_SCROLL_THRESHOLD = 80;

Callers 1

syncStreamScrollFollowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected