Skip to content

Multiselect

Unofficial

Multiselect component.

Import:

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

Signature:

export interface Multiselect

Properties

Property Type Description
elements HTMLDivElement[] The elements of the multiselect.
inputEl HTMLDivElement The input element of the multiselect.
inputText string The text of the input element of the multiselect.
rootEl HTMLDivElement The root element of the multiselect.
values string[] The values of the multiselect.

Methods

Method Returns Description
_createElement(value) null | string Create a new element for the multiselect.
_createInputEl() HTMLDivElement Create a new input element for the multiselect.
addElement(value) boolean Add a new element to the multiselect.
allowCreatingOptions(createOption) this Allow creating options for the multiselect.
changeCallback(values) void The callback for the change event.
createOption(this, value) string | undefined Create a new option for the multiselect.
editElement(index) void Edit an element of the multiselect.
findDuplicate(value, values) number Find a duplicate in the multiselect.
focusElement(index) void Focus an element of the multiselect.
onChange(changeCallback) void Handle the change event of the multiselect.
onOptionContextmenu(this, menu, value, ctx) void Handle the context menu event of the multiselect.
optionRenderer(value, ctx) void The renderer for the options of the multiselect.
preventDuplicates(findDuplicate) this Prevent duplicates in the multiselect.
removeElement(index, shouldFocus?) void Remove an element of the multiselect.
renderValues() void Render the values of the multiselect.
setInputText(text) void Set the text of the input element of the multiselect.
setOptionContextmenuHandler(onOptionContextmenu) this Set the context menu handler of the multiselect.
setOptionRenderer(optionRenderer) this Set the option renderer of the multiselect.
setupInput(this, inputEl, initializer) void The setup function for the input element of the multiselect.
setupInputEl(setupInput) this Set the setup function for the input element of the multiselect.
setValues(values) this Set the values of the multiselect.
triggerChange() void Trigger the change event of the multiselect.

Links to this page: