Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/Choices/MultiChoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Make sure the multi is unfolded (as it is in the screenshot). Click the drag han

## Placeholder text

You can optionally set a placeholder for each Multi choice. This text shows up in the choice picker search box when you open the multi, which is handy for complex menus or grouped workflows. Leave it empty to keep the default placeholder.
You can optionally set a placeholder for each Multi choice. This text shows up in the choice picker search box when you open the multi, which is handy for complex menus or grouped workflows. Leave it empty to use the multi name as the placeholder.
4 changes: 2 additions & 2 deletions src/gui/MultiChoiceSettingsModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export class MultiChoiceSettingsModal extends Modal {
new Setting(this.contentEl)
.setName("Placeholder")
.setDesc(
"Shown in the choice picker search box when this multi choice opens.",
"Shown in the choice picker search box when this multi choice opens. Leave blank to use the multi name.",
)
.addText((text) => {
text.setPlaceholder("Select an option...");
text.setPlaceholder("Defaults to the multi name");
text.setValue(this.placeholder).onChange((value) => {
this.placeholder = value;
});
Expand Down
2 changes: 1 addition & 1 deletion src/gui/suggesters/choiceSuggester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class ChoiceSuggester extends FuzzySuggestModal<IChoice> {

const nextPlaceholder = isBack
? this.placeholderStack[this.placeholderStack.length - 1]
: multi.placeholder?.trim() || undefined;
: multi.placeholder?.trim() || multi.name;
const nextStack = isBack
? this.placeholderStack.slice(0, -1)
: [...this.placeholderStack, this.currentPlaceholder];
Expand Down