Open matteosacchetto opened 10 months ago
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