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

Fix: Incorrect Implementation of View Pass Handler #137

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

robertqin86
Copy link
Contributor

@robertqin86 robertqin86 commented Oct 12, 2019

The eye icon (view pass) handler for the Input element secure text entry is not implemented correctly. The eye icon toggle is supposed to toggle between the secureTextEntry values of the password text input property, but it does not do that right now.

Current Bug:

Note setIsPassword(password) does not actually do anything since the password property is always true for password fields.

const viewPassElement = password && viewPass && (
    <TouchableOpacity style={{ marginLeft: 2 }} onPress={() => setIsPassword(password)}>
      <Icon
        size={iconSize || theme.SIZES.BASE * 1.0625}
        color={iconColor || theme.COLORS.BLACK}
        name="eye"
        family="entypo"
      />
    </TouchableOpacity>
  );

Solution in PR:

The solution is to toggle the isPassword flag instead.

const viewPassElement = password && viewPass && (
    <TouchableOpacity style={{ marginLeft: 2 }} onPress={() => setIsPassword(!isPassword)}>
      <Icon
        size={iconSize || theme.SIZES.BASE * 1.0625}
        color={iconColor || theme.COLORS.BLACK}
        name="eye"
        family="entypo"
      />
    </TouchableOpacity>
  );

@palingheorghe
Copy link
Collaborator

Thank you for this @robertqin86 ! This will get merged in the near future at the same time with the other bugfixes for v0.6.3.

@palingheorghe palingheorghe changed the base branch from master to dev October 15, 2019 15:45
@palingheorghe palingheorghe merged commit 43d076e into galio-org:dev Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants