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
Feature request idea(input): toggle the transform function when CTRL+SPACE is clicked #1330
Comments
Hi, I'm not against introducing this change. But I have a few questions UX wise.
Lastly, we should make sure the feature can be turned off with an option. There might be users who don't want to allow unmasking. Feel free to open a PR! |
Hi, thanks for the reply So, regarding your UX concerns:
Regarding the last point, I would actually say it would be better if it is disabled by default and you have an option to enable it. This way, the feature can be added without it being a breaking change. This weekend I will open a PR implementing the basic functionality |
This idea comes to mind especially from using the password prompt, where being able to toggle the visibility of the password may be something useful. So, today I was wondering if this was something others could be interested in and may be worth up-streaming to the input prompt.
Basically the idea is that, when the user presses the CTRL+SPACE key combination, the transform function is temporarily bypassed to allow the user to see the non-transformed input. If CTRL+SPACE is pressed again, then the transform function is again activated. Whenever the user presses the ENTER key the transform function will be applied independently if it was previously bypassed or not.
Implementing such functionality is rather easy and could be versatile in different situations from just the use in the password prompt, though could be interesting to hear some feedback on this by other users of this library.
For reference here is an example of the modified input prompt with the suggested feature implemented.
https://stackblitz.com/edit/stackblitz-starters-ed1f1b?file=index.ts
Thank you,
Matteo
The text was updated successfully, but these errors were encountered: