Renders the @mention suggestions that TextEditor portals to <body>.
useMentionAutocomplete fetches them and tracks the highlighted one.
f
MentionDropdown(unnamed 0: MentionDropdownProps): React.JSX.Element | null
Renders the matching users as a listbox, scrolled to keep the highlighted one in view, or nothing when none match. The keyboard stays in the textarea.
I
MentionDropdownProps
Passed to MentionDropdown by TextEditor, from the state of
useMentionAutocomplete.
-
id: string
The textarea's
aria-controls. Optionigets the id${id}-${i}, which the textarea names as itsaria-activedescendant. - onSelect: (username: string) => void
- results: UserSuggestion[]
- selectedIndex: number
-
style: CSSProperties
From
useAnchoredFloat, or hidden until it has placed the list.
Usage
import * as mod from "src/components/editor/MentionDropdown.tsx";