Skip to content

FuzzySuggestModal<T>

Official

Suggest modal for fuzzy search.

Import:

import { FuzzySuggestModal } from 'obsidian';

Signature:

export class FuzzySuggestModal<T> extends SuggestModal<FuzzyMatch<T>>

Extends: SuggestModal<FuzzyMatch<T>>

Constructor

new FuzzySuggestModal(app: App)

Constructor.

To extract the constructor type, use ExtractConstructor<FuzzySuggestModal>.

Properties

Property Type Description
chooser SuggestModalChooser<FuzzyMatch<T>, this> The suggestion chooser that manages selection and rendering.
(Inherited from SuggestModal)
clearButtonEl HTMLDivElement Button element to clear the input field.
(Inherited from SuggestModal)
ctaEl HTMLDivElement Call-to-action element displayed in the modal.
(Inherited from SuggestModal)
emptyStateText string The text to display when there are no suggestions.
(Inherited from SuggestModal)
inputEl HTMLInputElement The input element.
(Inherited from SuggestModal)
instructionsEl HTMLDivElement Element displaying keyboard shortcut instructions.
(Inherited from SuggestModal)
isOpen boolean Whether the suggest modal is currently open.
(Inherited from SuggestModal)
limit number The limit of the number of suggestions.
(Inherited from SuggestModal)
resultContainerEl HTMLElement The result container element.
(Inherited from SuggestModal)

Methods

Method Returns Description
getItems() T[] Get the items to be used in the fuzzy search.
getItemText(item) string Get the text to be used in the fuzzy search.
getSuggestions(query) FuzzyMatch<T>[] Get the suggestions for the fuzzy match.
onChooseItem(item, evt) void Called when an item is chosen.
onChooseSuggestion(item, evt) void Called when a suggestion is chosen.
onChooseSuggestion(item, evt) void Choose a suggestion.
(Inherited from SuggestModal)
onInput() void Handle input change in the suggest modal.
(Inherited from SuggestModal)
onNoSuggestion() void Set the callback to be called when there are no suggestions.
(Inherited from SuggestModal)
renderSuggestion(item, el) void Render the suggestion.
renderSuggestion(value, el) void Render a suggestion.
(Inherited from SuggestModal)
selectActiveSuggestion(evt) void Select the active suggestion.
(Inherited from SuggestModal)
selectSuggestion(value, evt) void Select a suggestion.
(Inherited from SuggestModal)
setInstructions(instructions) void Set the instructions.
(Inherited from SuggestModal)
setPlaceholder(placeholder) void Set the placeholder text.
(Inherited from SuggestModal)
sortSuggestions(suggestions) void Sorts the fuzzy-match suggestions, highest score first.
updateSuggestions() void Refresh the displayed suggestions based on the current query.
(Inherited from SuggestModal)

Links to this page: