Hide/Show Passwords: Ten Years Later

Programming - Apr 19, 2024

One of my first open source contributions was the hideShowPassword plugin for jQuery. (And Zepto! Remember Zepto?) It was inspired by the password experience Luke Wroblewski documented in Polar, which allowed you to toggle its visibility at any point. The detail I was most proud of was that the inset toggle control would not cause the password field to lose focus, so you could continue typing without interruption.

A password field is focused. The field's contents are obscured. A visibility toggle signified by an open eye icon is inset within the field. The iOS keyboard is displayed.
Prior to iOS 12.1.2, you could tap the icon to toggle password visibility…
The same password field as the previous image, except the password contents are visible, and the toggle affordance icon is now a closed eye. The field is still focused, the keyboard still visible.
…and the field would retain focus, allowing you to continue typing.

According to npm-stat, the plugin has been downloaded more than 380,000 times since it was first published to that registry. I’ve organically come across it myself in many login forms over the years, which always makes me smile (especially when they stick with my toggle icons).

But, we haven’t released an update since 2019, and we no longer use the plugin in our own projects. What changed?

Browsers did! The trick we used to retain password focus on toggle stopped working in mobile Safari in iOS 12.1.2 and later. A proposed new input-security CSS property was abandoned, concluding that the functionality should be handled by the browser. And as autofill and password managers became more powerful and commonplace, it became more cumbersome to prevent certain conflicts.

Our best practices have also evolved. We’re now far more aware of the accessibility hurdles for this sort of pattern. And JavaScript has progressed to the point where we only reach for jQuery on legacy projects.

You’d think it’d be a bummer to see a tool you wrote slip into obsolescence, but I don’t feel that way. The history of the web is full of stepping stones I fondly remember (sliding doors, sIFR and cufón, Flash). It’s always an honor to set a pebble or two along that path.

Previous Next
We respect the property rights of others, and are always careful not to infringe on their rights, so authors and publishing houses have the right to demand that an article or book download link be removed from the site. If you find an article or book of yours and do not agree to the posting of a download link, or you have a suggestion or complaint, write to us through the Contact Us .
Read More