Skip to content

TagInputSuggest

Suggests the vault’s tags in an <input>, whether or not the typed text starts with #. A picked tag is put into the input without the #.

Import:

import { TagInputSuggest } from '@mnaoumov/obsidian-lib/setting-components/tag-list-component';

Signature:

export class TagInputSuggest extends AbstractInputSuggest<TagSuggestion>

Extends: AbstractInputSuggest<TagSuggestion>

Constructor

new TagInputSuggest(app: App, inputEl: HTMLInputElement)

Creates a new tag suggest.

Properties

PropertyTypeDescription
inputElHTMLInputElementThe input the suggest completes.

Methods

MethodReturnsDescription
getSuggestions(query)TagSuggestion[]Gets the tags matching the typed text.
renderSuggestion(suggestion, el)voidRenders a tag with its note count.
selectSuggestion(suggestion, $event)voidPuts the tag into the input, dispatches an input event, then calls the onSelect callback.

Links to this page: