Comments (3)
The initial behaviour was meant to be that, but it seems some feature addition broke it.
However, since the default can be auto-completed, entering an empty string to return the default value seems slightly weird to me. Also, like before the default being returned cannot be a regular behaviour for all empty strings, since that disallows entering empty strings. Instead it would only return the default if the user hadn't made any changes to the string.
From a usability standpoint, I am leaning towards updating the docs to reflect the current behaviour. Is there any reason why the default value being returned for an empty string would be preferred?
from requestty.
I think what I really would like is some way to start the prompt with an initial value where things start out as if the user had just typed exactly that value in by hand. I imagine that the prompt would start out with that value entered, the cursor is at the end of those characters and the user could then either delete that value with backspace etc, or add more characters etc. Essentially a way to start out with an initial value without having to use auto-complete.
Maybe that is actually just a distinct concept from a default value, where the idea seems to be that if the user does not enter anything but presses Enter without any input, that value is going to be used? So maybe there should be another method initial_value
that is distinct from default
?
Also, it seems to me that if default
is specified, in general it just isn't possible to return an empty string, right? Isn't a default value simply a rule that if the user doesn't enter anything, then the default value is used?
from requestty.
Hmm, I get what you mean. It does make sense to have default
return on an empty string, so the earlier behaviour is correct. I'll fix the implementation to reflect what the docs say.
from requestty.
Related Issues (18)
- Builder error: unsupported pair HOT 2
- Remove screen size limit error HOT 1
- divisor of zero error requestty-ui-0.3.0 in MacOS 12.3.1 Docker 4.5.0 (74594) HOT 6
- dbg code in 0.4.0 HOT 2
- [Feature] Choose order of all options HOT 3
- [Question]: include more than one validator HOT 2
- [Bug] Requestty view doens't addapt when terminal size is changed + Panics if smaller than current view height HOT 1
- [Bug] Invalid cursor position
- Bugs with wide characters (like CJK) HOT 2
- Incorrect cursor location when input prompt spans multiple lines HOT 3
- Allow filtering a Select prompt HOT 2
- `adjust_page` called before `height` or `render` HOT 2
- Greyed-out text for the first autocompletion HOT 3
- Color input red as long as it doesn't pass validation HOT 1
- Support abort key HOT 1
- EditorBuilder: Change Editor Programatically HOT 1
- Allow setting of custom symbols
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 requestty.