MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / scrollToBottom

Function scrollToBottom

packages/utilities/src/scroll.ts:1–12  ·  view source on GitHub ↗
(node: HTMLElement, smooth?: boolean)

Source from the content-addressed store, hash-verified

1export function scrollToBottom(node: HTMLElement, smooth?: boolean) {
2 if (node) {
3 if (node.scroll && smooth) {
4 node.scroll({
5 top: node.scrollHeight,
6 behavior: 'smooth',
7 });
8 } else {
9 node.scrollTop = node.scrollHeight;
10 }
11 }
12}
13
14export function scrollToTop(node: HTMLElement, smooth?: boolean) {
15 if (node) {

Callers 4

ChannelFunction · 0.90
handleScrollFunction · 0.90
handleScrollFunction · 0.90
handleScrollFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected