A11y discussion: Combobox / MultiSelect Gray onHover contrast #7929
-
BackgroundIt was brought to our attention by an Accessibility expert that our current design when a user hovers over one of the options but it is not selected is too similar to an option that is selected. Testing / ReplicateTo see this, type 2 and then Enter (Option 2 is selected). Now type down arrow. Option 3 currently has focus, but it looks almost the same as Option 2 except for the checkmark. Ask / Discussion:
Potential Solutions
|
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 20 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Other thoughts:
|
Beta Was this translation helpful? Give feedback.
-
@andreancardona is this actually violating an accessibility rule? Why isn't the checkmark a sufficient indicator for selection? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
These are all the other components I could think of that use a selected darker background. So right now dropdown is following the system. If we change dropdown to not include a background change would we want change it everywhere? |
Beta Was this translation helpful? Give feedback.
-
Maybe auditing selected/hover states in all our components and seeing if there are better options is an effort we should focus on in our next major release. In my opinion, the hover/selected color difference has always felt weird to me bc it's so subtle, esp when navigating via keyboard, it looks so similar. Also, when an item is selected and it's being hovered on, there is not background change, which also doesn't seem right. On selectable data table, we still have the selected row change bg color when it's hovered on. I think, it is also important to note that some a11y testing needs to be done manually, which means that even if the Accessibility Checker doesn't throw and error, it doesn't mean that the component is 100% accessible inherently. I was trying to test this against different color blindness, but also wanna do more research as to how this affects keyboard users. My first thought, is that something that might help is to have the focus on the menu item when navigating via keyboard instead of the input like we do for OverflowMenu. I thought we did this, but maybe I was wrong or it changed. If it did change, I'd love to know more about why (if it was related to an a11y thing or a design change). I'd expect, that when I'm arrowing up or down through the items, they would have a focus border, but they don't. I think this would be more effective for keyboard users than just the bg hover change. As far as for mouse users, I'm not sure what would be a good fix since I wouldn't want a focus border when actually hovering. |
Beta Was this translation helpful? Give feedback.
-
Just catching up on this conversation now. I'll try and provide some guidance if I can. I guess the first thing worth noting is that multiple selection in a listbox from an accessibility standpoint is generally inadvisable and a group of check boxes is always preferable if possible. With that said what we have here is both a UX problem and an accessibility violation with our keyboard users getting the short shrift. As a quick aside -- something that may help is to stop considering MultiSelect as one singular component and think of it more as a compound component. With two distinct sub-components: a button and a listbox. The user's focus moves fluidly between these two components and selections are made in one that are represented in another. So with the button (input) focused via tab the user then can use either space or enter to open the listbox. When the listbox is opened focus moves from the button to the listbox. At which point the user can use up or down arrow keys to navigate within the listbox and make their selection(s).
So now with the listbox opened and selections made we see this In fact if the keyboard user has closed and then reopened the listbox they'll have to hit down arrow 4 times before an active list item can be discerned as seen here Aside from a poor experience for our keyboard users we have a contrast violation. The selected state and the active state need a 3:1 contrast as per the guidelines for UI Distinguishability in the IBM Accessibility Requirements which state, "any visual enhancement that indicates a state change needs to maintain a 3:1 contrast ratio against the meaningful adjacent colors". |
Beta Was this translation helpful? Give feedback.
-
Here are some possible visual indicator options for the new |
Beta Was this translation helpful? Give feedback.
-
Question: Can I was just nothing in firefox search bar it has a more subtle |
Beta Was this translation helpful? Give feedback.
-
Proposed solution for active state in list box@laurenmrice and I discussed in slack, we like this option. It keeps with our focus style, even though it's not technically focused. I will show it in Thursday's design crit to confirm with the rest of the team. |
Beta Was this translation helpful? Give feedback.
Proposed solution for active state in list box
@laurenmrice and I discussed in slack, we like this option. It keeps with our focus style, even though it's not technically focused. I will show it in Thursday's design crit to confirm with the rest of the team.