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

Function settleScrollBottom

demo/App.tsx:193–205  ·  view source on GitHub ↗
(
  container: HTMLElement | null,
  userScrolledUp: { current: boolean },
)

Source from the content-addressed store, hash-verified

191}
192
193function settleScrollBottom(
194 container: HTMLElement | null,
195 userScrolledUp: { current: boolean },
196) {
197 if (!container || userScrolledUp.current) {
198 return;
199 }
200 const distanceFromBottom =
201 container.scrollHeight - container.scrollTop - container.clientHeight;
202 if (distanceFromBottom < 120) {
203 easeScrollToBottom(container, 0.35);
204 }
205}
206
207export default function App() {
208 const [msgs, setMsgs] = useState<Message[]>([

Callers 1

AppFunction · 0.85

Calls 1

easeScrollToBottomFunction · 0.85

Tested by

no test coverage detected