Skip to content

DropDownCommand

A dropdown command shown in a SuggestModal’s instruction bar and bound to a modifier+key shortcut that cycles through its options.

Import:

import type { DropDownCommand } from 'obsidian-dev-utils/obsidian/modals/suggest-modal-command-builder';

Signature:

export interface DropDownCommand

Properties

PropertyTypeDescription
keystringThe key that cycles the dropdown to its next option.
modifiers?Modifier[]The modifiers combined with DropDownCommand.key to cycle the dropdown. When omitted, no modifiers are required.
purposestringThe human-readable description shown next to the dropdown in the instruction bar.

Methods

MethodReturnsDescription
onChange(value)voidCalled when the dropdown value changes.
onInit(dropdownComponent)voidCalled once with the created dropdown component, to initialize its options and state.