Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

380 B
Raw Blame
import { ref } from 'vue'

export function useChatScroll() {
  const containerRef = ref<HTMLDivElement | null>(null)

  function scrollToBottom() {
    if (!containerRef.value) return

    const container = containerRef.value

    container.scrollTo({
      top: container.scrollHeight,
      behavior: 'smooth',
    })
  }

  return {
    containerRef,
    scrollToBottom,
  }
}