Giter Club home page Giter Club logo

Comments (3)

Lutetium-Vanadium avatar Lutetium-Vanadium commented on May 28, 2024

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.

davidanthoff avatar davidanthoff commented on May 28, 2024

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.

Lutetium-Vanadium avatar Lutetium-Vanadium commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.