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

add show password toggle to secureTextInput #6501

Merged

Conversation

anthony-hull
Copy link
Contributor

@anthony-hull anthony-hull commented Nov 29, 2021

New PR continued from here due to GPG signing issues:
#4746

Details

Added a toggle button icon to password fields to change visibility

Fixed Issues

$ #2734

QA Steps

Web and Desktop:

  1. Type something into a password field
  2. Verify password is hidden
  3. Click eye icon
  4. Verify the password is visible
  5. Click again
  6. Verify it is hidden again

Android and iOS

  1. Type something into a password field
  2. Verify password is shown
  3. Click eye icon
  4. Verify the password is hidden
  5. Click again
  6. Verify it is shown again

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

setpassword screen web:
https://user-images.githubusercontent.com/47184118/129957727-cff28fb8-f9f5-4d6c-9d69-cd469e2e74e7.mp4

Edge

image
note the lack of vendor specific show password functionality

Mobile Web

image

Desktop

Screen.Recording.2021-09-15.at.18.57.37.mov

iOS

image

Android

image

@anthony-hull anthony-hull requested a review from a team as a code owner November 29, 2021 16:56
@MelvinBot MelvinBot requested review from deetergp and removed request for a team November 29, 2021 16:56
@anthony-hull anthony-hull mentioned this pull request Nov 29, 2021
5 tasks
@parasharrajat
Copy link
Member

@anthony-hull please add $ before the GH issue link. It's important for automation.

$ https://github.com/Expensify/App/issues/2734

@parasharrajat
Copy link
Member

cc: @johnmlee101 for review.

@anthony-hull
Copy link
Contributor Author

@johnmlee101 @parasharrajat
here is the new PR. I re-created a new branch with my changes as a single signed commit to fix the GPG signature issues on the other branch

@parasharrajat
Can you please review this again? :)

johnmlee101
johnmlee101 previously approved these changes Nov 29, 2021
Copy link
Contributor

@johnmlee101 johnmlee101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let @parasharrajat do final review 😄

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only a bug remaining and a few tweaks needed for the code.

Screenshot 2021-11-29 23:42:15

I won't bother you much so I have shared the fix in the review comments.

src/components/ExpensiTextInput/BaseExpensiTextInput.js Outdated Show resolved Hide resolved
src/styles/styles.js Outdated Show resolved Hide resolved
onPressOut={this.props.onPress}
translateX={this.props.translateX}
/>
<View style={[styles.flexRow]}>
Copy link
Member

@parasharrajat parasharrajat Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the zIndex: -1 to this View From the Textinput Style and remove it from Textinput

zIndex: -1,
. Otherwise Above mentioned issue....

@@ -167,7 +175,7 @@ class BaseExpensiTextInput extends Component {
{hasLabel ? (
<>
{/* Adding this background to the label only for multiline text input,
to prevent text overlaping with label when scrolling */}
to prevent text overlapping with label when scrolling */}
{this.props.multiline && <View style={styles.expensiTextInputLabelBackground} />}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add pointerEvents="none" to this View. it fixes one bug, not from your PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    expensiTextInputLabelBackground: {
        position: 'absolute',
        top: 0,
        width: '100%',
        height: 25,
        backgroundColor: themeColors.componentBG,
        borderTopRightRadius: variables.componentBorderRadiusNormal,
        borderTopLeftRadius: variables.componentBorderRadiusNormal,
        pointerEvents: 'none',
    },

Copy link
Member

@parasharrajat parasharrajat Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pointerEvents=none only work as a prop.

Co-authored-by: Rajat Parashar <parasharrajat@users.noreply.github.com>
@anthony-hull
Copy link
Contributor Author

There is only a bug remaining and a few tweaks needed for the code.

Screenshot 2021-11-29 23:42:15

I won't bother much so I have shared the fix in the review comments.

image

Also other pointer events bug
@anthony-hull
Copy link
Contributor Author

@parasharrajat can you please check again?

@@ -610,17 +613,21 @@ const styles = {
backgroundColor: themeColors.componentBG,
borderTopRightRadius: variables.componentBorderRadiusNormal,
borderTopLeftRadius: variables.componentBorderRadiusNormal,
pointerEvents: 'none',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works as a style. It is passed as a prop. Right? 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right there are some platform specifics in implementation when I looked it up. I need to use the prop for it to work.

parasharrajat
parasharrajat previously approved these changes Nov 29, 2021
Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the changes and patience.
All yours @deetergp @johnmlee101

@anthony-hull
Copy link
Contributor Author

No worries! thank you for your patience too!

@anthony-hull
Copy link
Contributor Author

anthony-hull commented Nov 30, 2021

merged your changes @parasharrajat
my screenshots look different to those in your PR
Screenshot 2021-11-30 at 12 53 41
Should the autofill background only be on the input? I quite like how this looks.

But it does introduce a contrast issue for accessibility. The label doesn't contrast enough against the background.

@parasharrajat
Copy link
Member

parasharrajat commented Nov 30, 2021

Sorry, which changes are you referring to? My PR is yet to be merged and If it merged before yours then you will have some conflicts for sure 😈

But it does introduce a contrast issue for accessibility. The label doesn't contrast enough against the background.

We are not worried about A11y issues ATM but tracking them. Thanks for pointing it out.

@anthony-hull
Copy link
Contributor Author

#4632 nvm! I didn't do a deep enough look. Just saw the screenshot on this was different to what I saw.

@parasharrajat
Copy link
Member

Oh about that. We have moved away from that change. That PR was about fixing autofill logic not the UI.

@anthony-hull
Copy link
Contributor Author

Looks like it is ok still. Can you re-review?

@johnmlee101
Copy link
Contributor

@deetergp going to skip your review since this was a duplicate (to fix signed commits). just FYI!

@johnmlee101 johnmlee101 merged commit c9f4292 into Expensify:main Nov 30, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Dec 7, 2021

🚀 Deployed to staging by @johnmlee101 in version: 1.1.17-8 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Dec 8, 2021

🚀 Deployed to production by @roryabraham in version: 1.1.18-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@mananjadhav
Copy link
Collaborator

I am tagging this PR to highlight an issue fixed here. All conditions in ternary expressions or left-hand operands on conditional renders, should be boolean. This PR is one of the PRs that uses conditional render with string operands, hence I am tagging it here for the contributors to check.

We've also updated the item in the checklist with this PR to avoid this issue in the future.

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

Successfully merging this pull request may close these issues.

5 participants