Skip to content
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

Combobox examples: Visual design review from PR #1255 #1263

Open
zcorpan opened this issue Nov 13, 2019 · 11 comments
Open

Combobox examples: Visual design review from PR #1255 #1263

zcorpan opened this issue Nov 13, 2019 · 11 comments
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern

Comments

@zcorpan
Copy link
Member

zcorpan commented Nov 13, 2019

Visual design review of combobox PR #1255

Review the visual presentation to assess whether look and feel is similar to typical modern implementations of the widget. Allow for adjustments to accommodate accessibility requirements in cases where most modern implementations are not sufficiently accessible.

There are 4 examples:

The first 3 have the same visual design, so I'll only review the first one of those ("example 1"). The grid popup example ("example 4") has different visual design.

Example 1

First, let's compare the default state of the example side by side in Safari (left), Chrome (middle), and Firefox (right).

The borders are different. The spacing between the combobox and the button is different. The combobox and the button don't align in Safari and Chrome.

The following screenshots are taken with Firefox Nightly on macOS.

Default state
The label State on one line, a gray textfield with a 2px inset border, next to it a gray button with a 2px outset border and a downward-pointing triangle.

Hover on the combobox field
The combobox has a black outline.

Hover on the button
The button has a black outline.

Focus on the combobox
The combobox has a blue outline and a light blue background.

Popup open
The popup is shown underneath the combobox. It has a gray background and a black border. The popup overlaps other content. The popup is wider than the combobox field, but narrower than the combobox and the button together.

After typing "Al" and focusing Alabama
The combobox has a black outline and contains the text Alabama. The popup has a blue border and shows the options Alabama and Alaska. Alabama in the popup has a light blue background. The popup has the same height as before.

Example 4

Default state in Safari (top), Chrome (middle), Firefox (bottom)
The combobox looks the same across browsers. It looks like a white text box with a thin gray border.

There is no provided styling for hover or focus. In Safari and Chrome, the default focus ring is shown. In Firefox, it is not. Removing the border-radius makes Firefox show its default focus ring. This might be a bug in Firefox? (Specifying -webkit-appearance: none has the same effect.)

After focusing and typing the letter "a"
A white popup with thin gray border is shown underneath the combobox, with options Apple, Artichoke, Asparagus, and each option has smaller gray text on the right hand side - Fruit, Vegetable, Vegetable. The popup is almost as wide as the combobox

Moving focus to the first cell of the first row
The first row has a blue background. The text Apple has a green dotted border around it.

Moving focus to the second cell of the first row
Same as previous except the green dotted border is around Fruit.

Typical modern implementations of the widget

Analysis

Our examples are not on par with modern design systems/component frameworks.

Example 1:

  • It is inconsistent between browsers.
  • It is, in my opinion, ugly. It doesn't look modern at all.
  • The black outline on hover is too stark and isn't found in other implementations. If anything, a hover effect is usually a subtle change in background color.
  • The dropdown button should be inside the combobox.
  • The popup should have the same width as the combobox.
  • The popup should have a nicer looking border than the thick black border.
  • The border style should be changed to look more modern.

Example 4:

  • In its default state, it looks reasonably modern, like a normal text field.
  • No custom focus style; in Firefox the applied styling but lack of focus style results in no focus indication (other than blinking cursor).
  • No indication that it is a combobox; maybe there should be a dropdown button?
  • The focus style in the popup (dotted green border) is ugly.
  • The ability to focus individual cells is confusing to me - selecting "Fruit" (second cell) results in "Apples" (first cell) being used as the value. Is this a good example for a Grid popup at all? (Maybe this is more of a functional review than design review, though.)
@JAWS-test
Copy link

No indication that it is a combobox; maybe there should be a dropdown button?

I think it is very important to have a visual indication for the role. A combobox should be visually different from an input field. A combobox with text input should also be visually distinguishable from a combobox without text input. Just like a <select size=1> should differ from an input field with <datalist>, because the handling is different.

@JAWS-test
Copy link

JAWS-test commented Nov 14, 2019

The focus indicator shows insufficient contrasts and thus violates WCAG SC 1.4.11:

  • blue background to white background: 2.0:1
  • green frame on blue background: 2.6:1

Minimum contrast is 3:1.

If the contrasts are adjusted, it should be noted that the selected element should also be visible in High Contrast Mode, i.e. the focus should not be represented exclusively by a color change.

In addition, WCAG 2.2 requires a minimum area for the contrast indicator (length of the element times 2px). I am unsure whether the green frame meets this requirement.

@mcking65
Copy link
Contributor

Per review by @smhigley in #1255: The selected option within the listbox is not visible in Windows high contrast mode.

@mcking65 mcking65 added bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern labels Nov 14, 2019
@mcking65 mcking65 added this to the 1.2 Release 1 milestone Nov 14, 2019
@mcking65 mcking65 changed the title Visual design review of combobox PR Combobox examples: Visual design review from PR #1255 Nov 14, 2019
@zcorpan
Copy link
Member Author

zcorpan commented Nov 14, 2019

@carmacleod wrote

the black hover outline appears when hovering over what looks like empty space off to the right of the button (but is actually the combo's label element). This feels unexpected.

This is because the label element is display: block. It's not just unexpected hover style; clicking or tapping there, with the intention of moving focus away from the combobox, has the opposite effect.

@carmacleod
Copy link
Contributor

carmacleod commented Nov 14, 2019

Wow @zcorpan ! Your commit 73ca367 makes the listbox combos look WAY better!

There's a Windows-Chrome issue (maybe others) with the 2nd and 3rd listbox combo, where the popup is aligned with the left edge of the label. Screenshots below:
image

image

@zcorpan
Copy link
Member Author

zcorpan commented Nov 14, 2019

I have made changes to examples 1-3 to try to address the design issues.

https://rawgit.com/w3c/aria-practices/issue1244-aria1.2-combobox-conversion/examples/combobox/combobox-autocomplete-both.html

It should work with Windows High Contrast Mode in Edge as well.

Screenshot showing dropdown option using highlight color in Windows High Contrast Mode.

I haven't changed example 4.

@carmacleod
Copy link
Contributor

carmacleod commented Nov 14, 2019

I liked the rounder corners... :)
And the different-color background for the combo and the list. :)

@zcorpan
Copy link
Member Author

zcorpan commented Nov 14, 2019

Yeah though @isaacdurazo said rounded corners are a bit passe. 🙂

@isaacdurazo
Copy link
Member

I also think the usage of rounded corners as well as some colors were inconsistent with the design of the rest of the page

@zcorpan
Copy link
Member Author

zcorpan commented Nov 14, 2019

Thanks @carmacleod! The labels in 2 and 3 should be moved outside of the combobox container in the markup.

@carmacleod
Copy link
Contributor

carmacleod commented Nov 14, 2019

@isaacdurazo said rounded corners are a bit passe. 🙂

Trends come and go... but science is here to stay. 😉
https://uxmovement.com/thinking/why-rounded-corners-are-easier-on-the-eyes/

Can we compromise and go with very slightly rounded corners like the middle button in this snap? 😄
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern
Projects
None yet
Development

No branches or pull requests

5 participants