Skip to content

CodeBlockBuilderConditionalDropdownField

A pair of cascading dropdowns: the first picks a group, the second one of that group’s options. Only the second dropdown’s value is written into the code block.

Import:

import type { CodeBlockBuilderConditionalDropdownField } from '@mnaoumov/obsidian-lib/modals/code-block-builder';

Signature:

export interface CodeBlockBuilderConditionalDropdownField extends CodeBlockBuilderFieldBase<string>

Extends: CodeBlockBuilderFieldBase<string>

Properties

PropertyTypeDescription
defaultValuestringThe value the field starts with. While the field holds it, the field writes nothing into the code block, unless it is CodeBlockBuilderFieldBase.isRequired.
(Inherited from CodeBlockBuilderFieldBase)
description?stringA description shown under the field's name.
(Inherited from CodeBlockBuilderFieldBase)
groupsreadonly CodeBlockBuilderOptionGroup[]The groups of options. The group containing CodeBlockBuilderFieldBase.defaultValue is selected first, else the first group.
isRequired?booleanWhether the field is always written into the code block. A required field is shown above the optional ones and has no reset button.
(Inherited from CodeBlockBuilderFieldBase)
keystringThe key the field's line is written with, and the key of its value in the values the preview receives. Unique across all fields.
(Inherited from CodeBlockBuilderFieldBase)
namestringThe name of the field, shown to the user.
(Inherited from CodeBlockBuilderFieldBase)
shouldOmitKey?booleanWhether the field's line holds its value alone, without the key: prefix.
(Inherited from CodeBlockBuilderFieldBase)
type'conditionalDropdown'The kind of the field.

Links to this page: