Skip to main content

Module: @lexical/react/LexicalTypeaheadMenuPlugin

References

Re-exports MenuOption


Re-exports MenuRenderFn


Re-exports MenuResolution

Type Aliases

Ƭ MenuTextMatch: Object

Type declaration

NameType
leadOffsetnumber
matchingStringstring
replaceableStringstring

Defined in

packages/lexical-react/src/shared/LexicalMenu.ts:38


TriggerFn

Ƭ TriggerFn: (text: string, editor: LexicalEditor) => MenuTextMatch | null

Type declaration

▸ (text, editor): MenuTextMatch | null

Parameters
NameType
textstring
editorLexicalEditor
Returns

MenuTextMatch | null

Defined in

packages/lexical-react/src/shared/LexicalMenu.ts:600


TypeaheadMenuPluginProps

Ƭ TypeaheadMenuPluginProps<TOption>: Object

Type parameters

NameType
TOptionextends MenuOption

Type declaration

NameType
anchorClassName?string
commandPriority?CommandListenerPriority
menuRenderFnMenuRenderFn<TOption>
onClose?() => void
onOpen?(resolution: MenuResolution) => void
onQueryChange(matchingString: string | null) => void
onSelectOption(option: TOption, textNodeContainingQuery: TextNode | null, closeMenu: () => void, matchingString: string) => void
optionsTOption[]
parent?HTMLElement
triggerFnTriggerFn

Defined in

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx:184

Variables

PUNCTUATION

Const PUNCTUATION: "\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;"

Defined in

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx:35


SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND

Const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{ index: number ; option: MenuOption }>

Defined in

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx:142

Functions

LexicalTypeaheadMenuPlugin

LexicalTypeaheadMenuPlugin<TOption>(«destructured»): JSX.Element | null

Type parameters

NameType
TOptionextends MenuOption

Parameters

NameType
«destructured»TypeaheadMenuPluginProps<TOption>

Returns

JSX.Element | null

Defined in

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx:202


getScrollParent

getScrollParent(element, includeHidden): HTMLElement | HTMLBodyElement

Parameters

NameType
elementHTMLElement
includeHiddenboolean

Returns

HTMLElement | HTMLBodyElement

Defined in

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx:110


useBasicTypeaheadTriggerMatch

useBasicTypeaheadTriggerMatch(trigger, «destructured»): TriggerFn

Parameters

NameTypeDefault value
triggerstringundefined
«destructured»Objectundefined
› maxLength?number75
› minLength?number1

Returns

TriggerFn

Defined in

packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx:147


useDynamicPositioning

useDynamicPositioning(resolution, targetElement, onReposition, onVisibilityChange?): void

Parameters

NameType
resolutionnull | MenuResolution
targetElementnull | HTMLElement
onReposition() => void
onVisibilityChange?(isInView: boolean) => void

Returns

void

Defined in

packages/lexical-react/src/shared/LexicalMenu.ts:199