Skip to content

PropertyValueSuggest

Unofficial

Suggest attached to the value input of a text or multitext property, offering the values the property already holds across the vault, or links once the value starts with [[.

Import:

import type { PropertyValueSuggest } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface PropertyValueSuggest extends AbstractInputSuggest<PropertyValueSuggestItem>

Extends: AbstractInputSuggest<PropertyValueSuggestItem>

Constructor

new PropertyValueSuggest(app: App, textInputEl: HTMLDivElement | HTMLInputElement)

Constructor.

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

Properties

PropertyTypeDescription
appAppThe Obsidian app instance.
(Inherited from AbstractInputSuggest)
contextPropertyRenderContextRender context of the property widget the suggest belongs to.
inputElHTMLDivElementThe contenteditable value input.
instructionsElHTMLDivElementElement holding the keyboard instructions shown under the suggestions.
isOpenbooleanWhether the suggestion popup is currently open and visible.
(Inherited from AbstractInputSuggest)
lastRectDOMRectThe last bounding rectangle used for positioning the suggestion popover.
(Inherited from AbstractInputSuggest)
limitnumberLimit to the number of elements rendered at once. Set to 0 to disable.
(Inherited from AbstractInputSuggest)
managerFileSuggestManagerManager providing the link suggestions.
scopeScopeThe scope for the keymaps.
(Inherited from AbstractInputSuggest)
sourcePathstringPath of the file whose property is edited.
suggestElHTMLDivElementSuggestion container element.
(Inherited from AbstractInputSuggest)
suggestInnerElHTMLElementThe inner element holding the rendered suggestions.
(Inherited from AbstractInputSuggest)
suggestionsSuggestModalChooser<PropertyValueSuggestItem, this>Handles selection and rendering of the suggestions.
(Inherited from AbstractInputSuggest)
textInputElHTMLDivElement | HTMLInputElementThe text input element this suggest is attached to.
(Inherited from AbstractInputSuggest)
winnull | WindowThe window the suggestion popover is shown in, or null while closed.
(Inherited from AbstractInputSuggest)

Methods

MethodReturnsDescription
attachDom()voidAttaches the suggestion popover to the document with an open animation.
(Inherited from AbstractInputSuggest)
autoDestroy()voidAutomatically destroy the popover when its associated element is removed.
(Inherited from AbstractInputSuggest)
autoReposition()voidAutomatically reposition the suggestion popover based on the input element.
(Inherited from AbstractInputSuggest)
close()voidCloses the popover.
(Inherited from AbstractInputSuggest)
detachDom()voidDetaches the suggestion popover from the document.
(Inherited from AbstractInputSuggest)
getLinktextQuery(text)stringGet the link query: the text between the opening [[ and the closing ]] or the caret, whichever comes first.
getSuggestions(query)Promise<PropertyValueSuggestItem[]> | PropertyValueSuggestItem[]Gets the suggestions for the input element.
(Inherited from AbstractInputSuggest)
getValue()stringGets the value from the input element.
(Inherited from AbstractInputSuggest)
onEscapeKey()voidHandle the escape key to close the popover.
(Inherited from AbstractInputSuggest)
onHistoryBack()voidCalled when the user navigates back in the history.
(Inherited from AbstractInputSuggest)
onInputChange()voidHandle changes to the input element's value.
(Inherited from AbstractInputSuggest)
onInputFocus()voidHandle the input element receiving focus.
(Inherited from AbstractInputSuggest)
onSelect(callback)thisRegisters a callback to handle when a suggestion is selected by the user.
(Inherited from AbstractInputSuggest)
onSelectedChange(value, evt?)voidCalled after every selection change, including the programmatic one that follows SuggestModalChooser.setSuggestions.
(Inherited from AbstractInputSuggest)
onSelectLink(value, evt)voidCalled with the value to commit when a suggestion is chosen.
open()voidOpens the popover.
(Inherited from AbstractInputSuggest)
renderSuggestion(value, el)voidRender the suggestion.
(Inherited from AbstractInputSuggest)
reposition(rect, textDirection?)voidReposition the popover relative to the given bounding rectangle.
(Inherited from AbstractInputSuggest)
selectCb(value, evt)unknownCallback for selecting a suggestion.
(Inherited from AbstractInputSuggest)
selectSuggestion(value, evt)voidCommit a suggestion, or the typed value when value is null (Shift+Enter).
selectSuggestion(value, evt)voidSelect a suggestion.
(Inherited from AbstractInputSuggest)
setAutoDestroy(el)voidSet the element that triggers automatic destruction of the popover when removed.
(Inherited from AbstractInputSuggest)
setValue(value)voidSets the value into the input element.
(Inherited from AbstractInputSuggest)
showSuggestions(suggestions)voidDisplay the given values as suggestions, truncated to limit, or close the popover if there are none.
(Inherited from AbstractInputSuggest)
suggestionFilter(value)booleanFilter applied to every suggestion, set by the multitext widget to hide values the property already lists.
updateInstructions(isLink)voidRefresh the keyboard instructions.