I noticed that showCursor
appears to not work if a mask
is set. Seems that functionality was explicitly guarded against: https://github.com/vadimdemedes/ink-text-input/blob/6c5b29d2ac595357e3ca64064b92e2e5856fcde5/src/index.js#L53
Just curious if there's a specific reason for hiding the cursor in this case? :)
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 :)
What's your use case?
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).
Most helpful comment
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).