Comments (5)
The older checkbox prompt had a short
option to shorten long choices: https://github.com/SBoudrias/Inquirer.js/blob/master/packages/inquirer/lib/prompts/checkbox.js
I don't know we need to keep the same API, but it's an option. Also, if we want to shorten the display, maybe we're better with a rendering function receiving the whole option list (so you could custom format like "a, b and 3 others", etc)
from inquirer.js.
@SBoudrias Are you open for a PR?
from inquirer.js.
Yes, happy to review and merge a PR.
I would recommend us aligning on the right approach to the problem though - want to make sure you don't waste your time if we end up feeling a different API would cover more cases!
from inquirer.js.
I would go with your second option, to provide a rendering function. I think it is the most flexible option. We could provide the rendering function with the list of all options AND the list of all selected options. Something like:
type RenderFn = (choices: ReadonlyArray<Choice<Value> | Separator>, selectedChoices: ReadonlyArray<Choice<Value>>) => string
But I'm open to everything.
from inquirer.js.
Yeah, that works. I like it - it's probably the most flexible option.
Just a nit that I'd flip the function params for all choices and selected choices.
from inquirer.js.
Related Issues (20)
- Bump `yoctocolors-cjs` to `2.1.2` for Deno compatibility HOT 4
- Possible bug on using inquirer inside of commitlint HOT 1
- High Severity ReDoS vulnerability in ansi-regex HOT 2
- Date prompt HOT 3
- New set implementation errors when overriding a boolean with an object HOT 3
- instanceof always returning false when checking for ExitPrompError errors HOT 5
- Program cannot be killed on powershell using Ctrl+c HOT 1
- prompt list returns undefined HOT 3
- Load more/append to list HOT 11
- [Feature]: inquirer/search - external pagination support (or be able to pass search value back to new instance) HOT 3
- [Feature]: inquirer/search - debounce support HOT 4
- How to get "Choice" type? HOT 6
- Guidance for unit tests HOT 2
- Ctrl+C breaks my terminal with "nested" prompts HOT 4
- Which version of @inquirer/prompts supports Node.js v16? HOT 1
- `[email protected]` has a missing type for `message` in prompt function HOT 5
- A way to fix flickering HOT 2
- Reuse prompt? HOT 3
- Handle ctrl+c gracefully HOT 4
- Proper text search in select? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inquirer.js.