survey icon indicating copy to clipboard operation
survey copied to clipboard

Added customisable hide character for password inputs.

Open SirRegion opened this issue 3 years ago • 2 comments

Hi @AlecAivazis and @mislav!

I had some free time so I tried my hand on implementing #386.

Changing the hide character of the password field works as expected. However, using an empty rune just results in the characters not getting hidden at all.

The best workaround for this is setting the custom hide character to an zero width space. This results in the behaviour required by the original poster.

I included an example for the password input, but I did not write a test for the behaviour. I also noticed that the existing password tests don't actually validate that the input is hidden, just that is is stored correctly. I'm sadly incapable of fixing those two issues.

SirRegion avatar Jun 23 '22 13:06 SirRegion

Thanks for putting this together @SirRegion! Mind putting a little note in the docs about the zero space width?

AlecAivazis avatar Aug 15 '22 16:08 AlecAivazis

@SirRegion there is now a merge conflct. I'd be happy to merge this once its ready (I can add the documentation after)

AlecAivazis avatar Sep 12 '22 07:09 AlecAivazis