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

PropertyTypeDescription
chooserSuggestModalChooser<FuzzyMatch<T>, this>The suggestion chooser that manages selection and rendering.
(Inherited from SuggestModal)
clearButtonElHTMLDivElementButton element to clear the input field.
(Inherited from SuggestModal)
ctaElHTMLDivElementCall-to-action element displayed in the modal.
(Inherited from SuggestModal)
emptyStateTextstringThe text to display when there are no suggestions.
(Inherited from SuggestModal)
inputElHTMLInputElementThe input element.
(Inherited from SuggestModal)
instructionsElHTMLDivElementElement displaying keyboard shortcut instructions.
(Inherited from SuggestModal)
isOpenbooleanWhether the suggest modal is currently open.
(Inherited from SuggestModal)
limitnumberThe limit of the number of suggestions.
(Inherited from SuggestModal)
resultContainerElHTMLElementThe result container element.
(Inherited from SuggestModal)

Methods

MethodReturnsDescription
getItems()T[]Get the items to be used in the fuzzy search.
getItemText(item)stringGet the text to be used in the fuzzy search.
getSuggestions(query)FuzzyMatch<T>[]Get the suggestions for the fuzzy match.
onChooseItem(item, evt)voidCalled when an item is chosen.
onChooseSuggestion(item, evt)voidCalled when a suggestion is chosen.
onChooseSuggestion(item, evt)voidChoose a suggestion.
(Inherited from SuggestModal)
onInput()voidHandle input change in the suggest modal.
(Inherited from SuggestModal)
onNoSuggestion()voidSet the callback to be called when there are no suggestions.
(Inherited from SuggestModal)
onSelectedChange(value, evt?)voidCalled after every selection change, including the programmatic one that follows SuggestModalChooser.setSuggestions.
(Inherited from SuggestModal)
renderSuggestion(item, el)voidRender the suggestion.
renderSuggestion(value, el)voidRender a suggestion.
(Inherited from SuggestModal)
selectActiveSuggestion(evt)voidSelect the active suggestion.
(Inherited from SuggestModal)
selectSuggestion(value, evt)voidSelect a suggestion.
(Inherited from SuggestModal)
setInstructions(instructions)voidSet the instructions.
(Inherited from SuggestModal)
setPlaceholder(placeholder)voidSet the placeholder text.
(Inherited from SuggestModal)
sortSuggestions(suggestions)voidSorts the fuzzy-match suggestions, highest score first.
updateSuggestions()voidRefresh the displayed suggestions based on the current query.
(Inherited from SuggestModal)

Links to this page: