Skip to content

feat(prompts,core): make autocomplete placeholder tabbable#485

Open
dreyfus92 wants to merge 2 commits intomainfrom
fix/tabbable-vals
Open

feat(prompts,core): make autocomplete placeholder tabbable#485
dreyfus92 wants to merge 2 commits intomainfrom
fix/tabbable-vals

Conversation

@dreyfus92
Copy link
Member

adds tabbable placeholder for autocomplete: when you set a non-empty placeholder and the field is empty, tab fills it with that text so options filter and you can confirm with enter.

closes #480.

@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2026

🦋 Changeset detected

Latest commit: 099430f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clack/prompts Patch
@clack/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

if (this.userInput === '\t') {
this._clearUserInput();
}
this._setUserInput(this.#placeholder, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, would this set the value to something other than options? Seems like we'd only want to enable this if placeholder exists within options

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Tab autocompletion using the placeholder as value not working

2 participants