Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value for suggester #555

Open
RyanQuey opened this issue Feb 9, 2022 · 1 comment · May be fixed by #1139
Open

Default value for suggester #555

RyanQuey opened this issue Feb 9, 2022 · 1 comment · May be fixed by #1139
Assignees
Labels
enhancement New feature or request

Comments

@RyanQuey
Copy link

RyanQuey commented Feb 9, 2022

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 RyanQuey added the enhancement New feature or request label Feb 9, 2022
@mnaoumov mnaoumov linked a pull request Jul 8, 2023 that will close this issue
@mnaoumov
Copy link

mnaoumov commented Jul 8, 2023

@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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants