-
Notifications
You must be signed in to change notification settings - Fork 20
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
Show password fixes #1947
Show password fixes #1947
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for sounding like a broken record on this. I'd like to question again why the word 'password' in 'show password' or 'hide password' needs to be hidden from anyone.
My thinking is that things should be available whether you use a screen reader or not - for example, the new guidance on image alt text is based on getting information to everyone regardless of how they access it. I think the same should apply for form fields - so having the full phrase will make it easier for everyone to use.
Herewith a better response. You're not sounding like a broken record, thanks for raising this. I agree on your point that things should be available whether you use a screen reader or not, but that's precisely what this change is designed to fix. Screen reader users have a unique problem - they can access the button without any context, which is why they need the more verbose text. However, sighted users also have a unique problem - page layout. They already have a visual cue to associate this button with the password (they can see the label, they can see the button is 'attached' to the input) but that has to fit into a narrow space. We could push the button down beneath the input on mobile, but that brings in new problems, like whether it still looks like a button. I can honestly see the argument on both sides, but I think this is the simpler solution, and it's the one DAC themselves suggested, who raised the issue in the first place. |
220561b
to
8bdfcc8
Compare
- the text for the show password component had been left in the input section of the yml file, after show password changed from being an option on the input component to being a separate component
- use aria-label to identify the button as 'Show password' or 'Hide password' to assistive tech, instead of just 'show' or 'hide' which isn't clear enough without context
8bdfcc8
to
571b56e
Compare
A thought for another time is whether having the button on the far right is a good thing for people who use screen magnifiers - the accordion component has just been updated to move the show / hide control to the left for that reason, so I wonder if this will need tweaking in the future for similar reasons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To misquote Voltaire, the perfect is the enemy of the good. This is really nice improvement that makes things better and should be in front of people as soon as possible.
What
Why
Trello card: https://trello.com/c/lNkwruEi/749-fix-accessibility-issues-raised-by-dac
Visual changes
None.
Needlessly detailed further background reading
Problem
Our password button says 'show' or 'hide', which has been highlighted as an accessibility fail because the button out of context doesn't make sense.
The solution proposed by the audit is to add the word 'password' as a visually hidden field. Sighted users would still see the button as 'Show' but screen reader users would hear it as 'Show password'. EDIT: we've chosen to go with a different solution due to all this stuff below here.
This works in English but other languages may have problems, specifically:
Since this would be in a separate element we need to keep the words 'show' and 'password' separate in the translation file.
Languages on GOV.UK
We should consider the impact this will have based on the languages it might be translated into. Starting with the totally unscientific approach, here are the largest translation files in government-frontend:
...but this text is used in elements like components and navigation, not published content.
As a more scientific approach (thanks @kevindew) this is a breakdown of what’s in Publishing API by locale:
Top results are:
A few hits of Google Translate later...
(note that I've had to put some filler text into some of these columns because both my local editor and github automatically changes some of the non Roman character set words based on the words that follow them, so please ignore
AAAA
in the following table. I don't know why it's doing this, I suspect it's changing the word order because they're right to left languages)Observations
Objective recap
Solutions
aria-label
, as suggested by the mighty @injms