跳到主要内容

ui/build/ai-elements/conversation/stick-to-bottom-context.svelte

ui/build/ai-elements/conversation/stick-to-bottom-context.svelte

Classes

StickToBottomContext

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:11

Stick-to-bottom for streaming chat.

User latch:

  • Any upward scroll / wheel-up → unlock (cancel pending pins)
  • Reach the bottom again (or scrollToBottom) → latch

While latched: content ResizeObserver pins scrollTop at most once per frame. Pins use a synchronous flag (not a time window) so user scroll-up is never swallowed.

Constructors

Constructor
new StickToBottomContext(): StickToBottomContext;

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:14

Returns

StickToBottomContext

Properties

isAtBottom
isAtBottom: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:13

scrollToBottom
scrollToBottom: (behavior?) => void;

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:17

Explicit latch + jump (scroll button / initial mount).

Parameters
Parameter Type
behavior? ScrollBehavior
Returns

void

Methods

setElement()
setElement(element): void;

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:15

Parameters
Parameter Type
element HTMLElement
Returns

void

Functions

getStickToBottomContext()

function getStickToBottomContext(): StickToBottomContext;

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:20

Returns

StickToBottomContext


setStickToBottomContext()

function setStickToBottomContext(): StickToBottomContext;

Defined in: apps/website/.api-docs-entry/ui/build/ai-elements/conversation/stick-to-bottom-context.svelte.d.ts:19

Returns

StickToBottomContext