-
Notifications
You must be signed in to change notification settings - Fork 319
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
Create password input component #4442
Commits on Mar 12, 2024
-
Prototype password input component
This is a (mostly) straight port of the JavaScript in GOV.UK Publishing Components combined with the text input component, with some minor alterations: - JavaScript has been modified to fit the Design System's coding and documentation conventions. - Support for configuration and localisation strings has been added. - The function to move specific data-attributes has been omitted for the time being. - Custom button styles have not been ported, instead using those from the Design System. - Configuration options (via JS or data-attributes) haven't been hooked up just yet.
Configuration menu - View commit details
-
Copy full SHA for 35225f1 - Browse repository at this point
Copy the full SHA 35225f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ef6b1cf - Browse repository at this point
Copy the full SHA ef6b1cfView commit details -
- Fix button appearing visually taller than the input - Fix button changing size when text updated by setting a sensible flex-basis - Fix button obscuring the input's focus style by adding a small space between the elements
Configuration menu - View commit details
-
Copy full SHA for ea53ddd - Browse repository at this point
Copy the full SHA ea53dddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 33a48cb - Browse repository at this point
Copy the full SHA 33a48cbView commit details -
Hide user agent password reveal function in Microsoft Edge
Microsoft Edge provides its own mechanism for users to show and hide their password in the form of an eye icon within the input. (The feature is built into Chromium itself, however only Edge appears to use it for inputs on the web. Google Chrome only appears to use it in browser dialogs and in the settings area of the browser.) We don't want to show this to our users. The button visually reproduces the functionality of our toggle, but in a way that we cannot syncronise with, thus it's possible for the two controls to present labelling that conflicts with the actual visibility of the password. We can use a vendor-prefixed pseudo-element to hide the button in Edge, but this doesn't disable other functionality that is specific to Edge's implementation, like the Alt+F8 keyboard shortcut.
Configuration menu - View commit details
-
Copy full SHA for 38f8834 - Browse repository at this point
Copy the full SHA 38f8834View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14a1b4a - Browse repository at this point
Copy the full SHA 14a1b4aView commit details -
Reset component state on pageshow event
If a user filled out a password input and then navigated away from the page via a link, it is possible to use the browser back button to return to the page with the password field populated. It could then be viewed and copied using the show button. This could potentially be used by bad actors to obtain user passwords. This code now blanks the input and resets the component state if the page is returned to, unless an explicit value has been set by the developer. Athough we cannot guarantee complete safety in this scenario (as the attacker evidently has obtained some level of physical or remote access already), it may make this attack vector slightly more difficult to accomplish.
Configuration menu - View commit details
-
Copy full SHA for 335926a - Browse repository at this point
Copy the full SHA 335926aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f77224 - Browse repository at this point
Copy the full SHA 0f77224View commit details -
- `spellcheck` was being set as a string despite govukInput expecting it as a boolean. - `autocapitalize` used the value 'off'. This appears to be a legacy value from the days it was specific to iOS, with 'none' being the newer, standardised value.
Configuration menu - View commit details
-
Copy full SHA for 1f9d107 - Browse repository at this point
Copy the full SHA 1f9d107View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc89d72 - Browse repository at this point
Copy the full SHA dc89d72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8524793 - Browse repository at this point
Copy the full SHA 8524793View commit details -
Configuration menu - View commit details
-
Copy full SHA for 436a555 - Browse repository at this point
Copy the full SHA 436a555View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85f7e76 - Browse repository at this point
Copy the full SHA 85f7e76View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9c64cf - Browse repository at this point
Copy the full SHA e9c64cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for da49337 - Browse repository at this point
Copy the full SHA da49337View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5915a66 - Browse repository at this point
Copy the full SHA 5915a66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a056a4 - Browse repository at this point
Copy the full SHA 2a056a4View commit details -
Assume Password input
$module
might be nullPossible return value from `document.querySelector()`
Configuration menu - View commit details
-
Copy full SHA for 028a282 - Browse repository at this point
Copy the full SHA 028a282View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a47001 - Browse repository at this point
Copy the full SHA 7a47001View commit details -
Configuration menu - View commit details
-
Copy full SHA for 022b000 - Browse repository at this point
Copy the full SHA 022b000View commit details -
Configuration menu - View commit details
-
Copy full SHA for b223bfd - Browse repository at this point
Copy the full SHA b223bfdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 800447d - Browse repository at this point
Copy the full SHA 800447dView commit details -
Helps JavaScript minifiers crunch this down more
Configuration menu - View commit details
-
Copy full SHA for e858b43 - Browse repository at this point
Copy the full SHA e858b43View commit details -
Configuration menu - View commit details
-
Copy full SHA for baf4927 - Browse repository at this point
Copy the full SHA baf4927View commit details -
Hide the password if the page is restored from cache
If the user navigates back to the page through some means (back/forward buttons, reopening recently closed tab, etc.), re-hide the password if it's currently visible.
Configuration menu - View commit details
-
Copy full SHA for 3e9792f - Browse repository at this point
Copy the full SHA 3e9792fView commit details -
Remove disableFormSubmitCheck option
Discussions with the contributor previously revealed that this was added defensively 'just in case'. As far as we are aware it hasn't actually been used anywhere (both via anecdotal evidence and the only GitHub search results being spec tests), indicating it has little to no actual user need or demand. In the interests of keeping things simple, we're going to remove this from our initial version.
Configuration menu - View commit details
-
Copy full SHA for f28aa29 - Browse repository at this point
Copy the full SHA f28aa29View commit details -
Configuration menu - View commit details
-
Copy full SHA for b48f702 - Browse repository at this point
Copy the full SHA b48f702View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77f00c3 - Browse repository at this point
Copy the full SHA 77f00c3View commit details -
Add "sign in" full-page example to review app
This example allows us to test the password input in the context of signing into an existing account. This is in contrast to "update your account details", which requests a new password instead of asking for the current one.
Configuration menu - View commit details
-
Copy full SHA for d0f5c45 - Browse repository at this point
Copy the full SHA d0f5c45View commit details -
Fix incorrect translation key being created
The code for setting the aria-label was generating the keys `showAriaLabel` and `hideAriaLabel`. The keys are actually `showPasswordAriaLabel` and `hidePasswordAriaLabel` respectively.
Configuration menu - View commit details
-
Copy full SHA for 9b716c5 - Browse repository at this point
Copy the full SHA 9b716c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca304eb - Browse repository at this point
Copy the full SHA ca304ebView commit details -
Make status announcement assertive
Changes the aria-live attribute of the hidden status element from "polite" to "assertive". This is intended to rectify an issue with VoiceOver on macOS, where the announcement would be spoken over by the changing text and aria-label of the toggle button. In this case, notifying the user that their password is visible (or not) feels like an important piece of information that should take priority.
Configuration menu - View commit details
-
Copy full SHA for c902abc - Browse repository at this point
Copy the full SHA c902abcView commit details -
Configuration menu - View commit details
-
Copy full SHA for fb86ccb - Browse repository at this point
Copy the full SHA fb86ccbView commit details -
Configuration menu - View commit details
-
Copy full SHA for d3d2215 - Browse repository at this point
Copy the full SHA d3d2215View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5aca96f - Browse repository at this point
Copy the full SHA 5aca96fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b1cfb89 - Browse repository at this point
Copy the full SHA b1cfb89View commit details
Commits on Mar 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 770a13c - Browse repository at this point
Copy the full SHA 770a13cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f349d7 - Browse repository at this point
Copy the full SHA 8f349d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf8d6c8 - Browse repository at this point
Copy the full SHA bf8d6c8View commit details -
Condense multiple toggle tests together
Co-authored-by: Romaric Pascal <romaric.pascal@digital.cabinet-office.gov.uk>
Configuration menu - View commit details
-
Copy full SHA for 6601ebe - Browse repository at this point
Copy the full SHA 6601ebeView commit details -
Set aria-live on component initialisation
Testing a hypothesis that VoiceOver failing to read the aria-live consistently may be due to it only being added when a status is set for the first time. If this is the case, then potentially it's also unnecessary to use assertive over polite.
Configuration menu - View commit details
-
Copy full SHA for 80d33b4 - Browse repository at this point
Copy the full SHA 80d33b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ee9365 - Browse repository at this point
Copy the full SHA 5ee9365View commit details
Commits on Mar 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5cd0c05 - Browse repository at this point
Copy the full SHA 5cd0c05View commit details -
Merge pull request #4763 from alphagov/show-hide-password-component-p…
…uppeteer-tests Add Puppeteer tests for Password input
Configuration menu - View commit details
-
Copy full SHA for 812387f - Browse repository at this point
Copy the full SHA 812387fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07d5621 - Browse repository at this point
Copy the full SHA 07d5621View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b5d976 - Browse repository at this point
Copy the full SHA 2b5d976View commit details