Comments (7)
This seems to be working. Did I miss anything? mhkeller@38c0f0a
from inquirer-autocomplete-prompt.
That was my thought as well. As you noticed this plugin currently forces you to choose a predefined one. But I also see the usefulness of being able to type anything you want. I was eventually planning to either support it with an option or create a stand alone plugin.
But don't know when I'll have the time to complete that, so if you create it, that is great!
Your changes seems to be the gist of it, although with your changes it seems that you only will be able to select something custom when the search string does not match anything. so you will not be able to enter "cookie" as a value if you have "cookie monster" in the list. Correct?
I would assume in such a plugin tabbing would autocomplete the selected choice, and enter would use whatever value you have typed, either your own or the autocompleted one.
Like so:
cookie => (tab) => cookie monster => (enter) => selects cookie monster
cookie => (enter) => cookie
Also, thanks for the interest and issue/PR reporting! I have had limited time to give this plugin enough love.
from inquirer-autocomplete-prompt.
Ah ya I hadn't thought of that one. There might need to be a larger UI change in order to disambiguate when you want "cookie" to autocomplete to "Cookie Monster".
I don't have that use case currently. so for now I'll look at integrating this set up as an option and PR.
Le Nov 7, 2015 à 06:40, Martin Hansen [email protected] a écrit :
That was my thought as well. As you noticed this plugin currently forces you to choose a predefined one. But also see the usefulness of being able to type anything you want. Was eventually planning to either support it with an option or create a stand alone one.
But don't know when I'll have the time to complete that, so if you create it, that is great!
That looks like the gist of it, although with your changes it seems that you only will be able to select something custom when it does not match anything. so you will not be able to enter "cookie" as a value if you have "cookie monster" in the list. Correct?
—
Reply to this email directly or view it on GitHub.
from inquirer-autocomplete-prompt.
I didn't see your flow layout above when I read this on my phone. Ya that seems reasonable although would "cookie monster" appear selected in the list after typing "cookie" before hitting tab?
Another way to do it is always display the arbitrary input in the list and preface it with some text or in a different style so the user knows it is not a part of the main list.
from inquirer-autocomplete-prompt.
@mhkeller could you open a PR with your changes? So the users now are not forced to choose one option?
from inquirer-autocomplete-prompt.
Or this PR does the same?
#9
from inquirer-autocomplete-prompt.
Closed in favor of #9 . It is now merged and published.
from inquirer-autocomplete-prompt.
Related Issues (20)
- Is it possible to multiple-select? HOT 1
- Typescript support? HOT 4
- Would it be possible to add a "default" option? Would you be open to a PR? HOT 2
- `rxjs` is required but not listed in `dependencies`, which causes Yarn@2 to fail to load the package
- Pagination HOT 1
- Better support for default value HOT 1
- [email protected] fails to install with [email protected] HOT 1
- TypeError: this.line.substring is not a function HOT 2
- Update rxjs to the same version as the latest inquirer
- Release notes for v2 HOT 1
- Support inquirer v9 HOT 1
- Supporting the name, value, short schema HOT 1
- Support ESM
- Does not work with inquirer.createPromptModule HOT 3
- Disable Case Sensitive HOT 1
- Idea: `emptyText` could be a function for reactivity HOT 1
- Handling errors HOT 3
- bug: Result of previous search can override current results HOT 3
- Display cursor when typing HOT 1
- Dynamic Import Not Working in Webpack Project HOT 3
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-autocomplete-prompt.