Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

mutating toggleMask prop throws JS errors #32

Open
mmw opened this issue Feb 24, 2016 · 0 comments
Open

mutating toggleMask prop throws JS errors #32

mmw opened this issue Feb 24, 2016 · 0 comments

Comments

@mmw
Copy link
Collaborator

mmw commented Feb 24, 2016

If toggleMask is set to false I cannot then set it to true. It throws an error that this.maskPassword is not defined.

Relevant line causing the issue: https://github.com/seethroughtrees/react-ux-password-field/blob/master/src/index.js#L212-L214

Solution: this.maskPassword should always be defined

Reason for wanting to mutate toggleMask:
if a user has "remember password" browser feature enabled the full password will flash when they navigate to a "settings" type page. For our project we'd prefer to not have this initial flash and instead only show the characters once we have real user input.

Alternatively this could be fixed by listening to key up/down events instead of change. I think the former solution is better. I'd be more than happy to submit a PR for this. Thoughts on approach?

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

No branches or pull requests

1 participant