Comments (10)
Listbox will share a lot of styles (if not all) with menu, but has slightly different ARIA semantics which we want to enforce.
Proposal:
Under the hood, both listbox and menu modules will resolve to a dropdown.css (the term 'dropdown' remains abstracted away to end users). This file will utilize grouped selectors, for example:
div.menu__item[role^="menuitem"],
div.listbox__item[role="option"] {
}
The one area where these might deviate is when we want to allow icons before the item text (e.g. country flags). Or maybe we just support that in both, I don't see why not.
from skin.
Going out on a limb ... what about emoji for flags? I know they would roast me for saying it, but almost all OSes and browsers support them now.
from skin.
Nice idea. Will check with design. They probably want to brand it in other ways than just the flag, but I will check that too.
from skin.
First pass at things. Should be fairly close to final, though: a781367
from skin.
Cosed via #50.
from skin.
So I have been doing a lot of digging around and testing of HTML select/listbox and our current ebayui listbox across screen readers and devices. Ultimately what we have is closest to how OS X treats a select element: as a popup button that expands a menu. Yup pretty much like our current menu component. However, this OS X treatment does not follow the W3C specification. Windows does. Windows treats a select as a readonly combobox.
So it's a difficult situation. Windows screen reader users will not be familiar with our popup button based implementation. Likewise, OS X users might find it odd to hear combobox instead of popup button. But my golden rule is to always go with the spec. If the spec ever happens to change to the OS X treatment, we follow suit. But the windows treatment and spec has been around a LONG time.
So, what this means is that the listbox now becomes quite different from the menu. There was also the issue that we can't give the button a label and a value (which a select can do), because a buttons inner value IS the label. So to accomplish this we have to change the button to a readonly textbox:
Cars
Pressing up and down arrow cycles through options. Pressing SPACE expands the listbox of options.
This means we also go back to the drawing board in skin to style a textbox to look like the expand button. Hopefully this is straightforward.
I am going to update the MIND patterns and hopefully put together a quick prototype.
Also, everything I have written above is for single-select only. I'm hoping multi-select can be achieved by using role="listbox" instead of role="combobox", but more investigation is needed.
Related reading: w3c/html#1013
Key piece from spec:
Allowed ARIA role attribute values:
(with NO multiple attribute and NO size attribute having value greater than 1) combobox or (with a multiple attribute or a size attribute having value greater than 1) listbox
from skin.
I updated the mind pattern example:
http://ianmcburnie.github.io/mindpatterns/input/listbox/
And docs:
https://ebay.gitbooks.io/mindpatterns/content/input/listbox.html
So far support seems good in IE+JAWS, FF+NVDA, Safari+VO, Chrome + Chromevox
from skin.
Thanks, @ianmcburnie!
from skin.
Current state of things: 7709f1f
from skin.
Done!
from skin.
Related Issues (20)
- tokens: add missing scrim tokens
- 230413 - Add Bookmark 24/16 and Update Play filled 24/16 icons.
- field: add character count section HOT 16
- Info icon component - Info icon is not centered in the container HOT 1
- deprecated icons: remove next major HOT 1
- 230427 - Update 12px chevron icon and spacing HOT 1
- ebay-textbox: border color not changing when focused
- [Update] Toggle button group HOT 1
- Toggle Button Group - New Component HOT 2
- ebay-tabs: add scrollable container option HOT 4
- ebay-listbox: missing error state HOT 1
- segmented-buttons: add large size HOT 1
- button: add small height
- image-treatment: right-click actions on image are being suppressed HOT 3
- Website: replace Jekyll with Marko Run
- Dialogs not opening correctly in Safari 13 HOT 3
- Button: keyboard focus indicator lacking affordance in Chrome
- floating-label: explore/implement markup restructuring for autofill reactivity
- Floating Label has a few edge cases with Chrome's autocomplete HOT 1
- page-notice: bad keyboard focus indicator color on CTA HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skin.