Problem/Motivation
I became more aware of screenreaders lately and the potential underlaying problems and roadblocks interacting with a webinterface. When reading the following article https://incl.ca/show-hide-password-accessibility-and-password-hints-tuto... (the linked website is currently unavailable due to a database error here is an alternative link on archive.org) I've tested the password suggestions functionality in the Drupal admin (I've used Claro as the admin theme) to see if it is accessible with VoiceOver in MacOS. Problem is the password suggestions box is placed after the password input field, it isn't associated with the input field in any way and there is also no feedback if one of the password suggestion constraints is met.
Steps to reproduce
- go to user/1/edit or admin/people/create
- interact with the page with a screenreader (VoiceOver in my case)
- tab until you reach the password field and start to enter a password
- tab to the confirm password field
- You will notice there won't be any feedback in regards of your input in the context of the password suggestions nor an announcement that there are any password suggestions until you reach them.
Proposed resolution
The previously mentioned article by Nicolas Steenhout already contains a few approaches how to improve the experience and the interaction for screenreader users. for example:
- place the password hints before the password input field instead of after it.
- associate the the password hint with the input using the aria-describedby attribute
And i have to admit i like the idea to prepend the list of password suggestions in paragraph form with the visibility-hidden css class before the visually visible password suggestions list.
p.s. i am not sure which component would be the most appropriate for this issue. i went with user system component cuz it applies to claro and seven both using seemingly the same pattern.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | oblivious.mp4 | 254.64 KB | rkoller |
| #27 | full.mp4 | 1.43 MB | rkoller |
| #22 | recommendations.mp4 | 1.98 MB | rkoller |
| #6 | wordpress_confirm_weak_password.mp4 | 1.12 MB | rkoller |
| #6 | craft_admin_update.mp4 | 1.81 MB | rkoller |
Issue fork drupal-3272325
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rkollerComment #3
rkollerComment #5
mweiler commentedI think this makes sense and is important. (I verified the problem with JAWS + Chrome on Target site, as was demonstrated in the linked video). I'm sighted and JAWS certified. I've come to recognize that there is a visual interface that we see on the screen and there is an aural interface that we hear with screen readers (JAWS, VoiceOver, NVDA etc.). They are two sibling interfaces and we have to train our ears to focus on the aural interface. When something important happens to the visual interface (e.g., message about characters needed for a password), we also need to make sure that it is available in the aural interface.
Comment #6
rkollerWe talked about the issue in todays a11y office hour (18.08.2022 -link to the notes).
Aside the issues described in the issue summary there was also noted that in case the user is zoomed in the password recommendation box might be missed. also people with visual disabilities and or problems with visual processing as well as the working memory might have problems with the functionality. remember the entered password for the confirmation dialogue, visually process the recommendations box which comes off as a wall of text with tiny typography and so forth. one link provided in regards of best practices was the following: https://www.nngroup.com/articles/password-creation/. for more details consult the linked meeting notes please.
We then agreed for illustration purposes to upload a screen recording to demonstrate the problems in Drupal on a Mac with voiceover. I've then extended the exercise to a few more CMSes to get an idea what others do well and where they also lack. Some of the videos are for already installed sites some were taken during the initial installation process. Disclaimer not all videos are perfect, using voiceover while performing a screen recording leads sometimes to odd browser behavior as well as reaction - there for apologies for the occasional hick ups.
- negative aspect
+ positive aspect
+/- mixed with positive as well as negative aspects
Drupal - installer
- the field for the new password is just called
passwordinstead of referring to the action. It could beChoose passwordorSelect password+/- the password strength is announced. but may be the wording could be front loaded. at the moment it is
password strength strong. front loaded it would becomestrong password strength. that way the screenreader user is able to aurally scan because the information of interest is the strength level and not the label of the level. and on a side note as you can hear withpassword strength fair,fairgets blended out and the volume is lowered - hard to understand but not sure what is causing that output?- there is no way to show the typed in password. for people with a small working memory that could turn into a problem to remember. to enter the password a second time from memory into the confirmation field could become a challenge. and there is also the general question of the reentering of the password for confirmation is necessary at all if it is possible to hide and show it. there is already an issue: https://www.drupal.org/project/drupal/issues/2293803
- the recommendations aren't announced and stay completely unnoticed (as already stated in the issue summary). plus why show the rules for the to be entered password after the first character is entered. at that point the user already made up their mind what password to enter in case they manually enter. now the sighted users have to stop compare from the top of their head the password they want to enter with the rules laid out. for screen reader users it would be even more challenging even if the recommendations are announced. they have to listen to the list of rules, memorize them and then check against their password choice - all from the top of their head.
Drupal - user profile
- the current password has to be entered at the beginning. three more fields down the DOM there is the password field. the two fields are spatially separated. if you know from the start that you are gonna change the password or email address then it is fine but if you wanna change it at a later point or if you even forget about that you have to enter the current password then the flow becomes inconvenient. that issue was already identified in one of the child issues of the following issue in the ideas queue: https://www.drupal.org/project/ideas/issues/3251513 (the issue is about user edit pages)
- the field for the new password is just called
passwordinstead of referring to the actionEnter new passwordlike it is named for the confirmation withconfirm passwordwhich could be also be changed toConfirm new password.* the rest of the points are identical with the drupal installer.
WordPress - installer
+ wordpress is autopopulating the password field with an randomly generated password string. the generated password is shown and not hidden per default. that way there is no real need to add a password recommendations text and the autogenerated string is used as illustrative material
- the announcing of the password strength as well as the input in general is overeager and gets announced too fast if there isn't any keyboard input
- the state of the show/hide button isn't announcedUpdate:
+ the state of the show/hide button is actually announced correctly. i've used the space and return key to interact with for example buttons but to have everything announced properly you have to use ctrl-option-space instead if used with voiceover i've learned. that way the state change is announced correctly. the focus remains on the hide and show button. to get the content of the field announced after you've made it visible by clicking the show button you have to shift tab once.
WordPress - user profile
+ the action
Set New Passwordis a dedicated button with a labelNew password.- after the
set new passwordbutton is clicked the button is still visible. it isn't apparent that it could be used to re generate a new password again and again.+/- i've created an additional wordpress_confirm_weak_password.mp4 recording. having a checkbox that appears to confirm that you are aware using a weak password i consider a good and useful practise from a security perspective, or at least a good compromise for local test installations. but the checkbox isn't getting announced and is placed after the cancel button. if someone directly saves the page after entering a new password, in case that was the only objective, then an error will turn up on the form.
Joomla
+ the sole password rule/requirement is clearly stated for everyone (sighted as well as screen reader users) with
enter at least 12 characters+/-
password doesnt meet the sites requirementsis announced after the first keystroke which is good. after that no state change is announced if the meter is going from red to yellow or yellow to green. the announcementpassword acceptedis misleading.+ the state of the button is announced aka the action and effect pressing the button.
Update: when the button is clicked the focus is automatically shifting back to the password field. in case you clicked the show button the password is getting automatically announced to you.
- my biggest gripe with the joomla installer. it looks you are on dedicated installer pages. you go through page one to four. two of the pages contain the action of choosing and entering a password. if one hasnt met the criteria you get an error at the end of page four and it turns out it is a single page overall and it is difficult based on the error messages even for a sighted user to know where the error was and in particular where to fix it cuz now all pages are shown at once.

Typo3
- the announcement of the recommendations showing up when the first character is entered into the password field gets immediately stopped on the second keystroke. if you enter a password manually you usually add the first one or two characters fast that way the announcement gets cut off. problem if you leave the field and reenter that announcement isn't made again. seems it is only announced when it showed up for the first time.
- the change of color code based on the password strength isn't announced to the screen reader.
- that there is a show and hide functionality isnt apparent. you have the lock icon which, me personally, i dont associate with a hide and show functionality. the icon also gets overlayed in part by the key icon from macos safari.
- the state change if the password is hidden or shown with the icon/button isn't announced.
CraftCMS - installer
+ it is using the text show and hide instead of an icon. that way it is crystal clear what the state and actions are (also for sighted users). and works well with the browser password icon.
Update:
+ the focus is switching from the show/hide button to the password field when clicked so the password gets properly announced directly. in contrast to the others clicking and announcing also works with space or return, ctrl-option-space isn't necessary.
- no feedback in regards of password requirements - and you are basically allowed to enter anything as short or long as you want. Update: it seems the password i've tested with had six characters which is the minimum character count as seen in the update for the craft cms user profile
CraftCMS - user profile
- you enter the new password but are unable to reach the save button by tabbing from the new password field on. had to use the mouse.
- the confirmation dialogue
enter your password to continueis super unclear what password to enter there. the old password or the new password to confirm it? as you can see at the end it was the old password. pretty confusing and unclear ux copy wise.Update:
- there are no requirements listed for the new password nor a strength indicator but after saving the new password i get the error
New Password should contain at least 6 characters.Possible steps for the Drupal implementation (i use a numbered list for easier reference)
aria-describedby. then the password strength would remain the only dynamic announcement to makeComment #8
mgiffordI think this just falls under WCAG 1.1.1.
Comment #9
nilubol commentedI tested keeping everything as-is and just adding aria-describedby to the password suggestion container, which does then expose this to screen readers. But, as mentioned, the placement and frequency with which this container updates isn't ideal.
If we keep the password suggestions where it is now (after the password fields), a user won't encounter this field until after they have already entered their passwords, rendering it useless or cumbersome to have to navigate back to update passwords. And as already mentioned by @rkoller, this can be missed by both sighted users as well as screen reader users.
If we move the password suggestions to above the password fields and leave it dynamic, the user will need to navigate past the (empty) suggestions box in order to get to the password fields. And because the list expands/contracts as you type in the password field, having this happen above the field you are typing in would be jarring to sighted users.
It seems that number four in @rkoller's list of suggestions makes the most sense here. A static, front-loaded passwords suggestion list reduces complexities and means that the user won't have to run through the password strength and list of requirements every time they type in the password field. Right now this content is being rendered in JS via user.theme.js so making this list static may also allow us to move this content into markup.
Additional usability review would be nice here. Sadly I just missed their office hours but adding the tag for visibility.
Comment #11
rkollerWe have discussed the issue at #3383430: Drupal Usability Meeting 2023-09-01. The issue will have a link to the recording of the meeting. For the record, the attendees at the meeting were @aaronmchale, @benjifisher, @emma-horrell, @lauriii, @rkoller, and @worldlinemine.
There was a clear consensus that this is relevant issue to fix. It was noted that in the future, with the introduction with additional authentication methods like single sign on, passkeys by the Fido Alliance, or mailed one time login links. But as long as Drupal provides the option to login with a username and password the password suggestions should be accessible to screenreader users as well.
The usability grouped signed off on the proposed resolution based on the linked article so work could take place to implement the solution.
I'll remove the Needs usability review for now but am following this issue anyway and I can bring in the issue to a future meeting again. I've also updated the issue summary because the page for the linked article is down due to a database issue so i've added a link to archive.org.
Comment #12
neclimdulIs the proposed resolution that was agreed to the static list?
Comment #13
mgiffordWe should definitely fix this. After listening to this page with a screen reader it clearly needs work. I think it was working better when we first introduced this in Drupal 7, but time erodes all things.
Comment #18
neclimdulTook a first pass at the proposal in the IS. Don't know if that was correct or not.
Couple changes:
I also had to mangle things a bit to push an id onto the suggestions but I think this might make things a bit better by not replacing the entire wrapper div. This might allow the aria-live to actually work.
Comment #19
smustgrave commentedAppears to have some javascript test failures.
Comment #20
neclimdulFair enough.
However, I don't think I've really got a firm answer on the correct approach and I had to modify the proposed resolution so before I go diving into tests I'm going to move this back to NR to get some review on the approach.
Comment #21
smustgrave commentedBeen about a month wonder if there someone that can be reached out to.
Comment #22
rkollerAt first thank you for the initial MR and apologies about the late reply - i had too many things in parallel the last few weeks. So far the issue was only discussed at the weekly ux meeting, therefore I've raised it at the last a11y office hour on the 2024-04-18 (for the record the attendees were @bnjmnm, @mgifford @psebborn @rkoller, @Sanna Kramsi (no username on d.o), @shaal, and @the_g_bomb).
The conclusion was two fold. First it looks like there is a regression in https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/user/... according to @bnjmnm. Both @bnjmnm and @mgifford were under the impression that the announcement of the suggestion was working in previous versions of Drupal. The agreed upon approach was opening up an additional issue to fix the announcement of the suggestions in the short term as a quick improvement (see #3444209: [Regression] Password recommendations are not being announced to screenreader users and to use this issue for coming up with a more future proof better approach.
In general the idea of informing the user upfront about the password requirements was considered a good thing (for sighted as well as screenreader users) but there was also the worry that there might be an information overload and with the password recommendation and password strength announcement working, things might become a little bit too verbose and overwhelming. We've taken a look at the current implementation of the patch on Safari 17.4.1 on macOS 14.4.1 with VoiceOver. Problem was that the initial entire set of recommendations wasn't announced still.
see https://www.drupal.org/files/issues/2024-04-29/recommendations.mp4 (for context at the beginning i've stepped through every available element with the voiceover cursor by tabbing "VO-arrow right" to make sure i am not missing some visual hidden instructions instead of stepping through by just using the tab key)
One suspicion the group had was that the reason why no announcement of all the recommendations takes place is that there might be a conflict with other content sent to the screenreader and that there is some sort of "race condition". One additional suggestion was to maybe go with
aria-describedby. But I agree with the reasoning in #11 thataria-detailsmight be the more appropriate pick semantically. but i did some digging yesterday and it turns out that the support foraria-detailsin particular for voiceover might be potentially problematic according to https://a11ysupport.io - maybe another explanation why the initial list of recommendations is not being announced?Taking a look at the current output you have the announcement of only one of the recommendations several times, the rest is going unnoticed, at the same time you have the announcement of the password strength alongside, plus at one point the announcement of that "bullet bullet". But that brings us back to the already mentioned information overload. With everything properly being announced a person would have to process the entire list of recommendations, then there will be a ping pong in between the strength indicator announcements and password recommendation announcements. One idea that was initially voiced during the meeting was to provide some sort of wizard for the aural interface - that way it would be ensured that only directly actionable information is provided to the user. But we haven't had enough time left on that day and agreed on continuing the discussion on this issue.
While writing up this comment i gave the problem some further thought and came up with the following suggestions:
add uppercase letters,add numbers,add punctuation) could be randomized. So before the first character is entered with the password field in focus the user would get as the call to action for example "add upper case letter" and then after satisfying that one the person gets the next. as soon as all three requirements announced in random order are satisfied one could get theat least 12 charactersrequirement as the final one. and when all requirements are met there could be an announcement, something like "your password is strong, you are meeting the requirements". the advantage, if someone copy and pastes the password from a text file or password manager, one would either get the requirements left to satisfy the outstanding requirements or directly end up with the "your password is strong..." announcement.123ora. The ideas were to either notify the user via an announcement while saving the user account (problem there, it could go unnoticed), add a confirmation step on save making the user aware that the chosen password is not strong enough satisfying the requirements, or go with a pattern wordpress uses by adding a checkbox on the user edit form making the user to confirm that one is aware and fine with using a not that strong password.Comment #23
smustgrave commentedThanks @rkoller for the great detail!
Comment #24
neclimdulTook a stab at laying down some ground work for the suggestions. This actually is pretty cool because a lot of the hardcoded things that made it impossible to really theme or extend the password strength region are tied to the strength indicator so focusing on the suggestions allows it to be more extensible which can sort of be seen in the latest updates.
I don't claim this is a "good" implementation but it hopefully keeps things moving forward.
Comment #25
neclimdulWould be great if someone could take a look at this and see if its on the right track before I spend too much time trying to polish it.
Comment #26
rkollerat first apologies, i somehow missed your last comment mid june. :( but i have taken a quick look at the current state now. at first happy to hear that with this approach a lot of hard coded things would be dropped. that sounds like a good thing, awesome!
in general, personally i like that the recommendations are shown now all the time next to the field for updating the password field instead of showing them right after the first keystroke. that is setting the context better for sighted users.
in regards of the experience for screenreader users i've created two small videos. in the first run through (full.mp4) all the recommendations are announced which was "sort of" an exception, during most of my tries the first announcement after the first keystroke was more like, see and hear in oblivious.mp4.
But the thing i wonder if we follow the idea to make those "call to action"/"recommendation" in random order is it then really necessary to provide a list of all four recommendations (or in case the list is extended by a contrib module there will be even more) it might be overwhelming and hard to memorize all of them at once. would it make sense and be technically possible to announce the first recommendation right after "password secure edit text with autofill menu" and not only after the first keystroke? so the user knows i am in a password field and i should add a number first for example ( another time the first recommendation would be start adding a lowercase letter for example). that way it would be a guided experience in case someone doesnt use a password manager or the browser password autogenerate or alike?
Comment #27
rkollerand forgot to actually upload the two videos
Comment #28
neclimdulNo worries! Thanks!
That's... interesting. It sounds like we're on the right track though so I'll take another pass at improving this.
Clearly relying on that live region isn't working out well. It looks like it doesn't announce anything if the removal is at the end and I suspect it doesn't behave all that well when the change is at the beginning and there are multiple items. That might be connected to the "oblivious" example as well, live regions and lists have been a source of frustration and I think nvda explicitly documents they might not work.
I'll poke around this time with direct announcements where we can control the behavior better. That will make things easier anyways since I can use devel_a11y to review things quicker.
Comment #29
itmaybejj commentedMy suggestion is to simplify and get rid of the live audio feedback altogether:
<details>if they want.Comment #30
mgiffordSeems like a good approach to me @itmaybejj
To add some additional context: