Skip to content

SuggestionContainer

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:7

Type Parameters

T

Properties

chooser

chooser: EditorSuggest<T>

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:11

Which suggestions should be picked from


containerEl

containerEl: HTMLElement

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:15

Pop-up element that displays the suggestions


selectedItem

selectedItem: number

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:19

The currently focused item


suggestions

suggestions: HTMLElement[]

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:23

List of all possible suggestions as elements


values

values: SearchResult[]

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:27

List of all possible suggestions as data

Accessors

numVisibleItems

Get Signature

get numVisibleItems(): number

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:31

Amount of suggestions that can be displayed at once within containerEl

Returns

number


rowHeight

Get Signature

get rowHeight(): number

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:35

Height in pixels of the selected item

Returns

number

Methods

addMessage()

addMessage(text): HTMLElement

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:40

Add an empty message with provided text

Parameters

text

string

Returns

HTMLElement


addSuggestion()

addSuggestion(suggestion): void

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:44

Add suggestion to container

Parameters

suggestion

SearchResult

Returns

void


forceSetSelectedItem()

forceSetSelectedItem(index, event): void

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:50

Set selected item to one specified by index, if keyboard navigation, force scroll into view

Parameters

index

number

event

Event

Returns

void

moveDown()

moveDown(event): boolean

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:54

Move selected item to next suggestion

Parameters

event

KeyboardEvent

Returns

boolean


moveUp()

moveUp(event): boolean

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:58

Move selected item to previous suggestion

Parameters

event

KeyboardEvent

Returns

boolean


onSuggestionClick()

onSuggestionClick(event, element): void

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:62

Process click on suggestion item

Parameters

event

MouseEvent

element

HTMLElement

Returns

void


onSuggestionMouseover()

onSuggestionMouseover(event, element): unknown

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:66

Process hover on suggestion item

Parameters

event

MouseEvent

element

HTMLElement

Returns

unknown


pageDown()

pageDown(event): boolean

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:70

Move selected item to the one in the next ‘page’ (next visible block)

Parameters

event

KeyboardEvent

Returns

boolean


pageUp()

pageUp(event): boolean

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:74

Move selected item to the one in the previous ‘page’ (previous visible block)

Parameters

event

KeyboardEvent

Returns

boolean


setSelectedItem()

setSelectedItem(index, event): void

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:78

Set selected item to one specified by index, invokes forceSetSelectedItem

Parameters

index

number

event

Event

Returns

void


setSuggestions()

setSuggestions(suggestions): void

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:82

Empties original container and adds multiple suggestions

Parameters

suggestions

SearchResult[]

Returns

void


useSelectedItem()

useSelectedItem(event): boolean

Defined in: src/obsidian/internals/SuggestionContainer.d.ts:86

Use currently selected suggestion as the accepted one

Parameters

event

Event

Returns

boolean