interface TextEditorHandle

Exposed through the ref of TextEditor, so that the component that opens an editor (a reply, an edit, the chat composer) can focus it.

Methods

focus(options?: { atEnd?: boolean; preventScroll?: boolean; }): void

Focuses the textarea. atEnd puts the caret after the last character and scrolls the text there. preventScroll leaves the page and its scrollers where they are.

Usage

import { type TextEditorHandle } from "src/components/editor/TextEditor.tsx";