Skip to content

Multiselect

Unofficial

Multiselect component.

Import:

import type { Multiselect } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface Multiselect

Properties

PropertyTypeDescription
elementsHTMLDivElement[]The elements of the multiselect.
inputElHTMLDivElementThe input element of the multiselect.
inputTextstringThe text of the input element of the multiselect.
rootElHTMLDivElementThe root element of the multiselect.
valuesstring[]The values of the multiselect.

Methods

MethodReturnsDescription
_createElement(value)null | stringCreate a new element for the multiselect.
_createInputEl()HTMLDivElementCreate a new input element for the multiselect.
addElement(value)booleanAdd a new element to the multiselect.
allowCreatingOptions(createOption)thisAllow creating options for the multiselect.
changeCallback(values)voidThe callback for the change event.
createOption(this, value)string | undefinedCreate a new option for the multiselect.
editElement(index)voidEdit an element of the multiselect.
findDuplicate(value, values)numberFind a duplicate in the multiselect.
focusElement(index)voidFocus an element of the multiselect.
onChange(changeCallback)voidHandle the change event of the multiselect.
onOptionContextmenu(this, menu, value, ctx)voidHandle the context menu event of the multiselect.
optionRenderer(value, ctx)voidThe renderer for the options of the multiselect.
preventDuplicates(findDuplicate)thisPrevent duplicates in the multiselect.
removeElement(index, shouldFocus?)voidRemove an element of the multiselect.
renderValues()voidRender the values of the multiselect.
setInputText(text)voidSet the text of the input element of the multiselect.
setOptionContextmenuHandler(onOptionContextmenu)thisSet the context menu handler of the multiselect.
setOptionRenderer(optionRenderer)thisSet the option renderer of the multiselect.
setupInput(this, inputEl, initializer)voidThe setup function for the input element of the multiselect.
setupInputEl(setupInput)thisSet the setup function for the input element of the multiselect.
setValues(values)thisSet the values of the multiselect.
triggerChange()voidTrigger the change event of the multiselect.

Links to this page: