Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
324 B · 13 lines
TypeScript
1234567891011121314type ChatScrollElement = Pick< HTMLElement, "clientHeight" | "scrollHeight" | "scrollTop">;
export function initializeChatScroll( element: ChatScrollElement, reversed: boolean,): boolean { if (element.clientHeight === 0) return false; element.scrollTop = reversed ? 0 : element.scrollHeight; return true;}