-
Notifications
You must be signed in to change notification settings - Fork 64
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 buttons in Adapt #446
Comments
I am in favour of the change but I see this change as part of a larger piece of work to organise buttons with Adapt. Overview of thoughts:
|
Counter arguments:https://uxmovement.com/buttons/why-you-shouldnt-gray-out-disabled-but The main issues appear to be:
It seems that switching the visual metaphor for representing the disabled state between greyed and faded, retains mostly the same issues. WCAG contrast requirements on inactive buttons:https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html#inactive-controls When we consider Unavoidable downsides of faded/greyed:https://medium.com/@h_locke/is-it-ok-to-grey-out-disabled-buttons-8afa74a0fae
With specific reference to contrast on disabled buttons w3c/wcag21#805 and w3c/wcag#922 There are a few suggestions the author has that we've not yet considered:
I quite like adding the disabled mouse cursor. Disabling vs hiding:
https://www.smashingmagazine.com/2021/08/frustrating-design-patterns-disabled-buttons/ Advantages of visible
When using a screen reader as a non-sighted user, UI changes, such as when buttons become shown or hidden or rearranged, are not alerted to the user. The unannounced introduction or removal of UI has the potential to disrupt a user's sense of object permanence and their orientation in the material, which introduces unnecessary cognitive load and potential confusion. This can be especially acute when hiding and introducing controls whilst navigating through a list of items. Secondarily to object permanence, and this applies to sighted users as well, are the possible affordances to a user from an If the narrative back button were initially hidden, it would not be possible for the non-sighted screen reader user to infer that a back button should appear later, that a list is beginning or that the list must be navigated via next/back controls. None of those affordances would be immediately available but they would appear after the user had experienced the first content item, when the back button would be shown and later found. By hiding the back button in this use-case, we'd effectively be teaching the user about the user interface during the essential material and not, as is ideal, before it, where allowing them to learn the UI, then use it to navigate and focus on the content seems the most efficient use of time. The case of the submit button is much the same as the narrative back button, in both regards. Having it readable+visible but disabled, signifies that it may become enabled. The instruction text, interaction description and UI all hint at the rules for its enablement. Tooltips:
Which disabled buttons would they apply to? Which user-groups would this solve for? Example:
|
For this reason, I think we shouldn't rely on colour alone (or opacity) to distinguish states (to be looked at as part of adaptlearning/adapt-contrib-core#386). For example, we could use the padlock icon for locked disabled buttons. Issue raised here for Tutor but a global approach to locked buttons in Adapt would make sense.
I'm in favour of disabling buttons rather than hiding.
Although this is true, I think the initial issues raised around needing to theme to any branding/colour palette still needs addressing and many brands do include, clash or too similar to grey. I'd be in favour of having an opacity as a standard disabled state in Adapt. Whilst maintaining flexibility to support more complex styles for those brands where a disabled state is defined in brand guidelines (to be looked at as part of adaptlearning/adapt-contrib-core#386). |
@kirsty-hames I like the option of being able to use opacity. Opacity example:There's a really good example highlighted in the reference w3c/wcag21#805 (comment) which links directly to the gov.uk disabled button spec https://govuk-elements.herokuapp.com/buttons/#button-disabled . Gov.uk have only described the one "primary button" style here, with the distinct green etc. They are using
Gov.uk's point on using In fairness Gov.uk do go on to explain the two use-cases where they expect a disabled button might be used:
Which is an unclickable list item with no children (calendar date with no booking, accordion item with no body, etc) and a continue button that requires further fulfillment (submit button on an mcq, locked menu button, etc). Icons for disabled state:
There are other mentions of using icons to indicate disabled states w3c/wcag21#805 (comment) . The "locked" state of plp, menu items and trickle are particularly good examples where there is a generic icon that represents why the button is disabled. Finding a similar uniform icon for the narrative back and question submit buttons might prove a little more difficult in the same way that trying to write tooltips for them is difficult. Perhaps something similar to the disabled cursor icon may work? Icons and tooltips:
Generally I think using tooltips to display disabled state is a cumbersome idea that we shouldn't implement. Disabled buttons, existing use-cases and recommendations:All disabled buttons should be We definitely have some use-cases for disabled buttons now:
"Visually disabled" = greyed / faded, disabled mouse cursor |
@StuartNicholls any thoughts? I think we just need a pr for the opacity on buttons to resolve this issue? Could we keep greyed as the standard and supply opacity as an option? The classes alignment (button type groupings), locked icons, disabled mouse cursor, etc can happen on different tickets. |
Yep, I purposely included that link with the counter arguments. I don't really see any of those as that much of an issue. The main reason I think the Opacity is a good idea for Adapt is that it goes some way to make configuring in AAT easier, its only really a suggestion from a workflow perspective, balancing all of the issues we have - which is more complex from say a standard website.
Yes, absolutely agree. I'm not sure its even solvable for all users. It will alway be a balance of requirements as requirements are often in conflict.
I'm not sure I agree it doesn't support a future direction in spirit! As I say, this is very much a balance of considerations. Personally, I don't think adding an icon is a good solution, as it adds visual clutter, so again, we've fixing one thing and breaking another. So, really, all it comes down to is balancing the solution in a different way.
Agree we should not
Yep, I like this plug-in, in someways this could be rolled in to Adapt.
Yep, as I say, opacity-ing the buttons doesn't seek to fix these specific issues. But, I don't like the idea of the cursor as its just a icon os ambiguous, its not really the right icon. A circle with a line though it indicates 'NO' as in no spoking etc. Plus more visual clutter. Personally, I'd rather not do this.
Submit, form like buttons, I like the idea of having a tooltip, so its behaves like the 'instructionError plug-in only, it gives immediate feedback before having to press the button. I'm. to previous about this though. Just thought it was a nice feature. |
Agreed, we should definitely distinguish locked states with a padlock. PLP for example. Additionally, visited states are now represented with a tick (check mark) so we should make sure they are all aligned also.
Agree. On balance, my feeling is moving over to opacity as standard is the best option currently. I'm not necessarily fixed on this but my feeling is, in production the first thing we'll do it switch from grey to opacity every project! |
I actually thing tooltips is a great idea here and not cumbersome at all. Icons on the other hand are problematic, as its not clear what they would be, and also adds visual clutter. But as I say, not precious about this, and there is the option of doing this, if say a ba=rand requires it, no? Tooltips support disabled buttons? We're only talking about the default state?
Nice! |
Yep, agreed. I did want to get this through before bringing up other buttons as this is quite complex in itself, as seen from the discussion! :) |
I'd rather go with the opacity myself mainly because of the workflow and config issue (as WCAG isn't giving a steer and its permissible) so lets not try and guess what will happen here. But I will go with the consensus. I'd only say, if we went with grey default, the first thing we'd do is switch is over for every project!
Yep, agreed. Although I don't like the cursor idea. :) |
So we're going with: All disabled buttons should be
Disabled button types:
Where form/question submit buttons are not visually disabled:
|
This sounds good to me. @guywillis / @kirsty-hames on board? |
--
I am 99% on board, yup. My only comment would be that I would vote in favour of disabled buttons to be greyed over faded out as it's a 'safer' option. Disabled buttons can be displayed over a multitude of background colours and images within Adapt and having buttons with a solid background would be more defined and easier to distinguish in my mind. It is, however, not a hill I will die on so if the general consensus is opacity I will go with it (providing the disabled button variables are still in place so that opacity can be switched off and the colour can be changed easily). |
I agree to all proposed and echo Guy's thoughts here. I was initially on board with the opacity so I am doing a 180 here, but after having many projects in recent months with high accessibility requirements I agree we should make sure we provide sufficient contrast for disabled buttons and this is easily done with a solid colour rather than opacity. I think opacity is much cleaner and modern but could be problematic when applying background colours/images etc. As a default, I would be inclined to go with the safer option too, solid grey. Side note to this, a bugbear for me is we also use grey for visited states. If we are sticking to grey as disabled I think the visited state should be changed. Issue raised in #470 |
Looks like we have consensus on the summary above. Amends will be required across various plugins so I've used the summary provided to create a checklist. Please edit, add links to issues/PRs as and when people pick tasks up. Global disabled buttons
Disabled button types:Locked
Buttons this applies to:
List start/end (can be mixed with next locking)
Form/question submit
Where form/question submit buttons are not visually disabled:
|
Subject of the enhancement
Suggestion for change of how disabled buttons are handled in Adapt.
Issues
Disabled buttons
Disabling buttons can be fairly contentious and web practitioners can have differing views on this topic.
Generally speaking, in UI/UX there are special cases where it may be beneficial to NOT disable buttons at all, but as Adapt already works by disabling, I haven’t addressed this here as see no need for a change. As a point of interest, you can find contrasting opinions on this here
Additionally, for completeness, two main approaches of handling disabled buttons are detailed here, but it is thought that continuing to disable buttons rather than hiding them strikes the best balance for Adapt. Historically, there have been implementation inconstancies in Adapt, so detailing these here if there are any non-contrib plug-ins still functioning like this.
Disabling
Seen in Adapt in the MCQ component.
Advantages of disabling:
Disadvantages of disabling:
Fortunately, there are remedies for the shortcomings:
Hiding
Historically seen in Adapt (e.g. Narrative) although this has been addressed in contrib plug-ins.
Advantages of hiding:
Disadvantages of hiding:
Proposal
Where we need to disable buttons, buttons should be reduced in opacity and not greyed out. This is to strike a balance of complex issues. Although greyed buttons have been used for some time, greyed buttons can look like a normal button and often don't look 'disabled', especially if the colour ways (brand colours/palettes) are similar or lighter colours making the ‘disabled’ button look more prominent. This is mainly a workflow issue as carefully selected greys can be fine, but we can automate this fiddly issue if we opacity the button in the theme. Especially relevant now as this will help with theming in AAT.
It might seem that changing the opacity of buttons would have implications for accessibility but according to WCAG, disabled buttons don’t have to adhere to AA colour contrast requirements, see here, and here. A nice analysis of these points can be found here.
For best practise (not required by WCAG) to account for usability/accessibility issues, disabled buttons could have a tooltip explaining that its disabled and the reason for the disabled state. Although my feeling is, this could be optional on a project by project basis or not needed at all.
Implementation
In terms of actioning this, should we decide this is a good idea, there are some quirks in the theme that may need addressing.
Expected behaviour
Changing the less variable to an opacity changes all UI disabled buttons in Adapt.
Actual behaviour
Some buttons change but buttons like the next and previous in the narrative component are coloured as 'items'. Some rationalisation of what is a button and what constitutes an item may be required.
Screenshots
Example of what a disabled button might look like:
The text was updated successfully, but these errors were encountered: