Templater
Templater copied to clipboard
Default value for suggester
Is your feature request related to a problem? Please describe. I want to have a default value for suggester. Placeholder is ok, but having a default value is often helpful, e.g., when I want to search all markdown files based on a previous user input.
Describe the solution you'd like Add a param for default value
Describe alternatives you've considered Using placeholder, and have user type in the input again.
@RyanQuey I also needed this functionality. I just added the PR for that. But until it is released you can use a hack for that
const valuePromise = tp.system.suggester(text_items, items, throw_on_cancel, placeholder, limit);
setTimeout(() => {
const input = document.querySelector('.prompt-input');
input.value = initial_query;
input.dispatchEvent(new InputEvent('input'));
}, 0);
const value = await valuePromise;