App icon indicating copy to clipboard operation
App copied to clipboard

Feature Suggestion: show password toggle on password fields

Open anthony-hull opened this issue 5 years ago • 44 comments

View password feature on password fields

Motivation

Improve accessibility for users.

Implementation

I think it would be good to replicate the UX of Edge browser where when you type it shows an icon button inside the field to toggle show password. You should also be able to tab to the icon on desktop to maintain keyboard nav.

Edge cases: Hiding native view password icon in Edge Password managers tamper with the DOM in this location

Upwork job: https://www.upwork.com/jobs/~01f52f49fe3707fca2

anthony-hull avatar May 07 '21 09:05 anthony-hull

Holding until https://github.com/Expensify/Expensify.cash/issues/1517 is closed then I'll start a review. @anthony-hull I'm going to assign to you for now, can you kick it back to me once 1517 is closed and I'll take it from there?

mallenexpensify avatar May 07 '21 18:05 mallenexpensify

Was about to suggest this feature and found an open issue for it 😃

cc'ing @mallenexpensify since the PR you mentioned is closed now.

rdjuric avatar Jun 22 '21 21:06 rdjuric

Ahh yes. I forgot this one was open :) Thank you Rafael

anthony-hull avatar Jun 22 '21 22:06 anthony-hull

@anthony-hull can you provide more detail on what you're recommending, and possibly include a screenshot or vid? Any chance this has been discussed in Slack, #expensify-open-source yet? If so, can you drop in a link? Thanks

mallenexpensify avatar Jun 23 '21 23:06 mallenexpensify

Yes we had a discussion on slack I will follow up with a video on Monday. I'm busy the next 4 days.

anthony-hull avatar Jun 24 '21 07:06 anthony-hull

I think it's best to show the password by default on mobile devices. You can trivially move your screen in a way to obscure the password as you type. Additionally as you type there is a large on screen keyboard that people can watch you enter it on. I'm not sure there is much of a security gain from it vs the loss of UX.

On desktop, mask passwords by default, but add a “Show” option so that people can remember the password and check their work. On mobile, unmask passwords by default, but add a “Hide” option. It’s especially hard to type a complex, secure password on mobile. Unmasking passwords on mobile is not really hurting security very much. Mobile keyboards indicate exactly which letters were typed, anyway.

Ironically now I think of it, I just added the confirm password field in the set password form. If you allow the user to check their work or show by default you can remove the need for repetition. We could have just one entry box and make it easier.

I think behaviour of showing and hiding that mailchip implemented is a nice way to go: https://login.mailchimp.com/signup/ image image

Or how Edge does it with the icon inside the input: image image

We could hide the password again when the box loses focus.

anthony-hull avatar Jun 28 '21 18:06 anthony-hull

Thanks @anthony-hull , I'm double checking to make sure this isn't something that's already being worked on internally. I'll followup tomorrow

mallenexpensify avatar Jun 28 '21 22:06 mallenexpensify

Thanks for holding, nobody mentioned this is something that's currently be worked on. I agree this is feature that would be useful. First, can you take a peek at this issue to see if any work being done there would help on mobile for this issue? https://github.com/Expensify/Expensify.cash/issues/3108 (I have no idea, just searched 'show password' in the repo to ensure something wasn't already being worked on).

Then, can you submit a proposal for how you want to implement this and I'll assign an engineer to review? Thanks

mallenexpensify avatar Jun 29 '21 15:06 mallenexpensify

It would make sense to use the new input component in that issue. I'm happy to hold until it's merged. When secureTextEntry is passed into the component I would change the behaviour to:

Implement the show/hide icon as a background image svg with onClick handlers to change the visibility of the text input. The visibility can be controlled by changing the props passed to the wrapped text input field.

anthony-hull avatar Jul 01 '21 11:07 anthony-hull

Triggered auto assignment to @deetergp (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Jul 02 '21 18:07 MelvinBot

Triggered auto assignment to @puneetlath (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Jul 02 '21 18:07 MelvinBot

I used Exported to assign an engineer for review. @deetergp , can you review @anthony-hull 's proposal?

@puneetlath , I unassigned myself then added External because I'm OOO next week. Also, I removed Exported label because it hasn't been posted to Upwork yet, it makes more sense to me to get Deeter to agree on the solution before posting.

mallenexpensify avatar Jul 02 '21 18:07 mallenexpensify

The feature @anthony-hull proposes sounds good, but we're going to need a more detailed description about how he is going to do it before moving forward.

deetergp avatar Jul 02 '21 21:07 deetergp

The exact UX isn't agreed. https://github.com/Expensify/Expensify.cash/pull/3414/files

The following props are set for TextInputs are used for passwords:

secureTextEntry
autoCompleteType="password"
textContentType="password"

When textContentType is set to password in the props of ExpensiTextInput: src/components/ExpensiTextInput/index.js I will add an SVG of an eye or whatever icon I'm given to the input. Above or inside the input depending on the designs. I will hold state in the ExpensiTextInput component for show password or not. When you click on the icon it will toggle that state. The state will control the Icon shown and if the secureTextEntry is true or false when passed into the wrapped TextInput component:

<Icon name={this.state.iconType} onPress={() => this.toggleShow />
<Input secureTextEntry={this.state.show}  />

anthony-hull avatar Jul 05 '21 13:07 anthony-hull

Your proposal makes sense and sounds good, @anthony-hull. Thanks!

@puneetlath I am unsure of the next step, since this has not been posted on Upwork.

deetergp avatar Jul 06 '21 17:07 deetergp

Created the Upwork job and invited @anthony-hull to it: https://www.upwork.com/jobs/~01f52f49fe3707fca2

puneetlath avatar Jul 06 '21 17:07 puneetlath

I accepted the job on UW. I can start work with what I have. But in parallel: Ideally I would like an eye icon of two states provided by your designers. I see you have: image in Expensify.cash\assets\images

But I think we need a toggled state with the eye closed to show the different hidden/shown states.

anthony-hull avatar Jul 06 '21 20:07 anthony-hull

@Expensify/design anyone able to help with icons for this?

puneetlath avatar Jul 06 '21 21:07 puneetlath

I can grab this quick as we already have the icon, I just need to export it to an SVG: image

shawnborton avatar Jul 06 '21 23:07 shawnborton

Here is the svg: eye-disabled.svg.zip

shawnborton avatar Jul 06 '21 23:07 shawnborton