-
Notifications
You must be signed in to change notification settings - Fork 90
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
Disabled button styles do not have sufficient contrast #201
Comments
Seen easily and obviously disabled seems like conflicting goals. |
Disabled buttons are useful to prevent double form submissions, especially on a slow connection and it takes time for the form to submit. |
In that use case, is fading the button the best visual solution? Maybe a spinner or something? |
I think we should separate the discussion of whether 'disabled' styles should exist from whether they're accessible. For the purposes of this issue, it would be good if we had a style that supports users with visual impairments whilst also looking correct. |
I agree a better disabled style that is accessible is a good thing. I use the disabled styles in the use case above, so wouldn't want to see them go (without fighting my corner). |
Interestingly it seems meeting contrast checks for inactive elements is not a W3C accessibility requirement. "Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement." Link: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html See also these interesting threads: |
That thread also argues that disabled buttons are not 'pure decoration', so are not incidental. |
Have we got any research that shows people with visual impairments have a worse experience because of this issue? The first thing to do seems to be gathering examples of disabled buttons that help any kind of user, then testing to see if the impact is the same. |
I don't know about any specific research we've done, but the contrast ratio of 2.48:1 is well below the recommended WCAG ratio, so some users will definitely be effected. Can you clarify your 'first thing to do' suggestion? |
Find example of actual user needs for disabled buttons, and testing them (and alternatives) with users with visual disabilities and without |
I guess I'm trying to work out what need disabled buttons are solving more generally. One need that's mentioned above is to stop people from trying to "double submit", but it's also been mentioned we could solve that by using a spinner instead of a fade. Is there anywhere else disabled buttons are used? If we can find them, and identify what usefulness they have, then we can test to see if they have the same usefulness for people who can't see them. |
Right, gotcha. Some possible use cases off the top of my head - would be good to see what others use if for:
|
In general I feel like we're agreed that disabled buttons tend to be a bad thing. I'm a very digital native user and I've often tried to click them in the past. I'm always annoyed by the fact that clicking them does nothing. Even in the case of the zooming on a map for instance, it would probably be useful to have a message that says "You've zoomed to the maximum level." |
Would be good to see what others use them for - I agree in most cases you can and should avoid them. Mine were just examples of possible use cases. To your comments:
nb: If google had a popup "You've zoomed to the maximum level." each time you zoomed in fully - I think that would be mighty annoying. In that case I reckon doing nothing feels better. Depends on the action though. |
Clarification for the usage issues outlined in alphagov#201 (although not the core issue of contrast).
Added a PR just to try and address some of the issues around usage, but the core problem of accessibility is still there. Would adding a border around the button solve the issue? |
@aduggin, it would be great to get your feedback on this one. |
how about changing the content of the button to reflect the current state? we typically advise against using colour to infer meaning. is this different? |
we could replace the button content with a spinner animation? That will always fit in the existing button width |
Doesn't the spinner indicate that something is happening? Ie it could work for some usages of disabled buttons (pause while uploading?), but not others? |
@markhurrell I think it better to say that we'd advise against using colour as the only way of conveying meaning. It can be very helpful as an additional way. |
@edwardhorsford yeh we had that discussion downstairs :) in this case, the disabled state is only being shown through a change in colour/saturation, but yes the advice is specifically about not being the only way, as you say. |
It's fun, |
"Not available" is clearly better than "disabled", but people still need to know why it's not available. PR #212 aims to add guidance around this. However, regardless of supporting content, we still need a visual design for the button that is accessible. Would be good to know if adding a border could work. |
Apologies for not seeing this thread and replying sooner. From a technical accessibility point of view (i.e what do you need to do to pass WCAG), my understanding is that a disabled button doesn't have to pass minimum colour contrast requirements. There is a thread about this on WebAIM mailing list: The rationale for this is explained by here:
It's the lack of contrast that conveys this information. It seems odd, |
However, someone with great vision can still easily read the button label, and know that the action they want to do exists, its just disabled for now (if they understand that from the visual design which is arguable). I think this is another reason not to use disabled buttons if at all possible. |
Additional guidance on using disabled buttons is added in #304 |
The style for disabled buttons does not have sufficient contrast - it's 2.48:1.
IMHO in most cases we should avoid using disabled styles, but where they are needed, we should come up with a style that can be seen easily.
The text was updated successfully, but these errors were encountered: