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

mutating toggleMask prop throws JS errors #32

@mmw

Description

@mmw

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions