Templater
Templater copied to clipboard
multiple select prompt
Is your feature request related to a problem? Please describe. I want to be able to spawn a suggester prompt with the possibility to select multiple items.
Describe the solution you'd like A System Module function which spawns a multiple selections prompt and returns the user's chosen items as a comma-separated list.
Similar to the suggester function of the System Module, it could look like this:
tp.system.multipleselect(text_items: string[] ⎮ ((item: T) => string), items: T[], throw_on_cancel: boolean = false, placeholder: string = "")
which then returns a string value1, value2, value3.
Describe alternatives you've considered
Maybe it's possible to extend the suggester function to allow for multiple select.
You are correct that suggester could be invoked multiple times. Supercharged links did this but it recently split off into two different plugins, one of which retains this behavior.
Is this likely to be supported at some point?
It's unlikely to happen in the near future I think. None of the maintainers have the time.
You could kind of accomplish this by running the suggester multiple times in a loop...
const selections = []
while (selections.length <= 3) {
const selection = await tp.system.suggester(["foo","bar","baz"],[1,2,3])
selections.push(selection)
}
// do stuff with selections
Its a good idea but ideally, you'd be able to choose how many options you end up choosing right and idk of a way to do that without a confirm end prompt between each solution which would just be horrible ux. (i.e. for choosing what languages you speak - some speak 1 others speak 5).
Just as reference, if I could introduce new prompts to the tp.system, I would add:
- Multiline suggester (either fixed or unfixed number of items)
- Slider between two value
- Date selection
- Time selection
I know these can already be pretty easily done so they should be far from the top of the list, but improving user input ux would go a long way in allowing pre-populating of notes.
It would just be lovely if this was core though of course I understand the maintainers are busy with other more important things. Really appreciate all the time all of you have put into this!
Can you check if the metadata menu plugin fits your needs?
I've been meaning to take a dive into that. I'll have a look when I can and let you know. Thanks for the suggestion!
I think it would be very helpful to have multi select prompt. Is there anyone working on this, I would like to try working on this feature.
Please go ahead and submit a draft PR, I'm more than happy to provide feedback.
Hello @AB1908 I just submitted a draft PR, Please take a look at it and tell me if anything can be improved.