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

Feature request idea(input): toggle the transform function when CTRL+SPACE is clicked #1330

Open
matteosacchetto opened this issue Nov 14, 2023 · 2 comments

Comments

@matteosacchetto
Copy link
Contributor

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

@SBoudrias
Copy link
Owner

Hi, I'm not against introducing this change. But I have a few questions UX wise.

  1. How do we make this feature discoverable? (small help tip?)
  2. Is there common shortcuts used out there to unmask a password input? I'd like us to base ourselves on anything that is out there and potentially known already.

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!

@matteosacchetto
Copy link
Contributor Author

matteosacchetto commented Nov 17, 2023

Hi, thanks for the reply

So, regarding your UX concerns:

  1. I think we could manage to show an help tip, we just need to think of a way for it to be helpful and not distracting
  2. I do agree with your view, though I have not yet found a common shortcut used by various applications. I found some references to ALT+F8, other to CTRL+SHIFT+C... I will look into this further

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants