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
| Property | Type | Description | |
|---|---|---|---|
| app | App | The Obsidian app instance. (Inherited from AbstractInputSuggest) | |
| context | PropertyRenderContext | Render context of the property widget the suggest belongs to. | |
| inputEl | HTMLDivElement | The contenteditable value input. | |
| instructionsEl | HTMLDivElement | Element holding the keyboard instructions shown under the suggestions. | |
| isOpen | boolean | Whether the suggestion popup is currently open and visible. (Inherited from AbstractInputSuggest) | |
| lastRect | DOMRect | The last bounding rectangle used for positioning the suggestion popover. (Inherited from AbstractInputSuggest) | |
| limit | number | Limit to the number of elements rendered at once. Set to 0 to disable. (Inherited from AbstractInputSuggest) | |
| manager | FileSuggestManager | Manager providing the link suggestions. | |
| scope | Scope | The scope for the keymaps. (Inherited from AbstractInputSuggest) | |
| sourcePath | string | Path of the file whose property is edited. | |
| suggestEl | HTMLDivElement | Suggestion container element. (Inherited from AbstractInputSuggest) | |
| suggestInnerEl | HTMLElement | The inner element holding the rendered suggestions. (Inherited from AbstractInputSuggest) | |
| suggestions | SuggestModalChooser<PropertyValueSuggestItem, this> | Handles selection and rendering of the suggestions. (Inherited from AbstractInputSuggest) | |
| textInputEl | HTMLDivElement | HTMLInputElement | The text input element this suggest is attached to. (Inherited from AbstractInputSuggest) | |
| win | null | Window | The window the suggestion popover is shown in, or null while closed.(Inherited from AbstractInputSuggest) |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| attachDom() | void | Attaches the suggestion popover to the document with an open animation. (Inherited from AbstractInputSuggest) | |
| autoDestroy() | void | Automatically destroy the popover when its associated element is removed. (Inherited from AbstractInputSuggest) | |
| autoReposition() | void | Automatically reposition the suggestion popover based on the input element. (Inherited from AbstractInputSuggest) | |
| close() | void | Closes the popover. (Inherited from AbstractInputSuggest) | |
| detachDom() | void | Detaches the suggestion popover from the document. (Inherited from AbstractInputSuggest) | |
| getLinktextQuery(text) | string | Get 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() | string | Gets the value from the input element. (Inherited from AbstractInputSuggest) | |
| onEscapeKey() | void | Handle the escape key to close the popover. (Inherited from AbstractInputSuggest) | |
| onHistoryBack() | void | Called when the user navigates back in the history. (Inherited from AbstractInputSuggest) | |
| onInputChange() | void | Handle changes to the input element's value. (Inherited from AbstractInputSuggest) | |
| onInputFocus() | void | Handle the input element receiving focus. (Inherited from AbstractInputSuggest) | |
| onSelect(callback) | this | Registers a callback to handle when a suggestion is selected by the user. (Inherited from AbstractInputSuggest) | |
| onSelectedChange(value, evt?) | void | Called after every selection change, including the programmatic one that follows SuggestModalChooser.setSuggestions. (Inherited from AbstractInputSuggest) | |
| onSelectLink(value, evt) | void | Called with the value to commit when a suggestion is chosen. | |
| open() | void | Opens the popover. (Inherited from AbstractInputSuggest) | |
| renderSuggestion(value, el) | void | Render the suggestion. (Inherited from AbstractInputSuggest) | |
| reposition(rect, textDirection?) | void | Reposition the popover relative to the given bounding rectangle. (Inherited from AbstractInputSuggest) | |
| selectCb(value, evt) | unknown | Callback for selecting a suggestion. (Inherited from AbstractInputSuggest) | |
| selectSuggestion(value, evt) | void | Commit a suggestion, or the typed value when value is null (Shift+Enter). | |
| selectSuggestion(value, evt) | void | Select a suggestion. (Inherited from AbstractInputSuggest) | |
| setAutoDestroy(el) | void | Set the element that triggers automatic destruction of the popover when removed. (Inherited from AbstractInputSuggest) | |
| setValue(value) | void | Sets the value into the input element. (Inherited from AbstractInputSuggest) | |
| showSuggestions(suggestions) | void | Display the given values as suggestions, truncated to limit, or close the popover if there are none.(Inherited from AbstractInputSuggest) | |
| suggestionFilter(value) | boolean | Filter applied to every suggestion, set by the multitext widget to hide values the property already lists. | |
| updateInstructions(isLink) | void | Refresh the keyboard instructions. |