method TextEditorHandle.focus
TextEditorHandle.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.

Parameters

optional
options: { atEnd?: boolean; preventScroll?: boolean; }

Return Type

void

Usage

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