MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / isScrollAtBottom

Function isScrollAtBottom

packages/utilities/src/scroll.ts:29–37  ·  view source on GitHub ↗
(node: HTMLElement)

Source from the content-addressed store, hash-verified

27const SCROLL_AT_BOTTOM_TOLERANCE = 3;
28
29export function isScrollAtBottom(node: HTMLElement) {
30 if (!node) {
31 return false;
32 }
33 return (
34 Math.abs(node.scrollHeight - node.scrollTop - node.clientHeight) <=
35 SCROLL_AT_BOTTOM_TOLERANCE
36 );
37}
38
39export function isInViewport(node: HTMLElement) {
40 if (!node) {

Callers 2

handleRootScrollFunction · 0.90
handleRootScrollFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected