Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "transform" callback to input() method #88

Closed
bitspittle opened this issue Oct 14, 2022 · 1 comment
Closed

Add "transform" callback to input() method #88

bitspittle opened this issue Oct 14, 2022 · 1 comment
Labels
enhancement New feature / functionality

Comments

@bitspittle
Copy link
Contributor

Imagine you're typing a password. It could be nice to do something like this:

input(transform { ch -> '*' })

If you do this, the underlying value is still valid. It's only what's printed to the screen that is changed.

Question: Should the transformation work per character? Or on the whole input?

e.g. password could be this:

input(transform { str -> "*".repeat(str.length) })
@bitspittle bitspittle added the enhancement New feature / functionality label Oct 14, 2022
@bitspittle
Copy link
Contributor Author

The transform method should definitely return a single character. There's a bunch of logic around cursor movement that would be really weird if the transformation was not one to one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature / functionality
Projects
None yet
Development

No branches or pull requests

1 participant