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

Showing the cursor with masked text #41

Closed
colinking opened this issue Sep 22, 2019 · 3 comments · Fixed by #57
Closed

Showing the cursor with masked text #41

colinking opened this issue Sep 22, 2019 · 3 comments · Fixed by #57

Comments

@colinking
Copy link

I noticed that showCursor appears to not work if a mask is set. Seems that functionality was explicitly guarded against:

if (showCursor && !mask && focus) {

Just curious if there's a specific reason for hiding the cursor in this case? :)

@vadimdemedes
Copy link
Owner

The motivation behind introducing a mask property was to allow entering passwords, and those are usually masked with * or empty string for obvious reasons. I see that in the most places I've seen password inputs, cursor is hidden, so I just rolled with the same behavior :)

@vadimdemedes
Copy link
Owner

What's your use case?

@colinking
Copy link
Author

Hey @vadimdemedes!

For my use-case, I have an input for a masked API token which is one step in a form with a series of different inputs. Some are text inputs, some are select inputs, but in all cases, there's some kind of indicator indicating what the user needs to do (an indicator next to a select option, a cursor in a text input, etc.). The one exception is the masked API token field since showCursor=true doesn't enable the cursor.

Ideally a cursor could be shown to indicate that the input is "focused" and ready to accept text, otherwise there's no visual clues and the user may end up confused about what to do (short of me adding placeholder text, but I'd rather prefer consistency).

image

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

Successfully merging a pull request may close this issue.

3 participants