Inquirer.js
Inquirer.js copied to clipboard
Disabled style
Would you be open to change the "disabled" appearance?
Things I think would improve the UX:
- Remove the
-
prefix, so that the options become aligned (as it currently is the disabled options actually stand out more than the active ones) - Don't prevent the user from selecting one but refuse accepting it with Enter, and change the cursor to become
✗
instead of❯
. Potentially make the line red instead of blue. - In my case the reason why an option is disabled is part of the generated label, so I'd also like a way to disable the default
(Disabled)
suffix - otherwise I have to parse my generated label
? Which range to you want to use in @berry/pnp ❯ devDependencies? (Use arrow keys)
❯ Keep webpack@^4.28.4 (no changes)
Reuse webpack@^4.28.4 (originally used by @berry/[email protected], @berry/[email protected], [email protected])
- Use latest (unavailable because enableNetwork is toggled off) (Disabled)
Would become:
? Which range to you want to use in @berry/pnp ❯ devDependencies? (Use arrow keys)
❯ Keep webpack@^4.28.4 (no changes)
Reuse webpack@^4.28.4 (originally used by @berry/[email protected], @berry/[email protected], [email protected])
Use latest (unavailable because enableNetwork is toggled off)
? Which range to you want to use in @berry/pnp ❯ devDependencies? (Use arrow keys)
Keep webpack@^4.28.4 (no changes)
Reuse webpack@^4.28.4 (originally used by @berry/[email protected], @berry/[email protected], [email protected])
✗ Use latest (unavailable because enableNetwork is toggled off)
I can offer to make the PR if you like those changes.
This change looks fine to me. Let's just add an error message "this option is disabled" when pressing enter on a disable line.
I'd also like it if you could alter the color for disabled choices (like grayed out).
@verheyenkoen You could use FORCE_COLOR=0
to disable colors. See https://github.com/chalk/chalk#supportscolor.
@LitoMore I mean that I'd like it if you could tweak the color somehow for disabled choices (using colors "dim" or "blackBright/gray"), so it's more clear that they are not available. Currently they only have a textual prefix/suffix and default color, and the prefix is confusing as it could be interpreted as hierarchical: