Skip to content

fix(core, prompts): correctly render the disabled options of selectKey - #622

Open
btea wants to merge 1 commit into
bombshell-dev:mainfrom
btea:fix/correctly-render-disabled-option
Open

btea wants to merge 1 commit into
bombshell-dev:mainfrom
btea:fix/correctly-render-disabled-option

Conversation

@btea

@btea btea commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

refer to #620 (review)

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d14250

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

This PR includes changesets to release 2 packages
Name Type
@clack/core Patch
@clack/prompts 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

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

commit: 7d14250

});
this.cursor = Math.max(keys.indexOf(opts.initialValue), 0);
const cursor = Math.max(keys.indexOf(opts.initialValue), 0);
this.cursor = this.options[cursor]?.disabled ? findCursor<T>(cursor, 1, this.options) : cursor;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

im not sure this is right. we do this in selects because if you press up/down, we want to hop over the disabled options.

but in select-key, there's no concept of directional movement through options. so if you set the initial value to a disabled one, we should probably just ignore it.

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.

2 participants