material icon indicating copy to clipboard operation
material copied to clipboard

mdSelect: Add select component

Open ajoslin opened this issue 12 years ago • 105 comments

The mdSelect is a type of Material Design Menu that behaves like and resembles a <select>.

Menu behavior

Functional requirements

- Menu should be positioned over their "emitting" elements, establishing context - The selected menu item should not be shown as a duplicate when expanded - Dismiss menu by selecting an item (unless selecting multiple), tapping outside the menu, or using the Escape key - Menu animates out from emitting item when expanding

Accessibility requirements

- **mdSelect element** - `[aria-live="polite"]` makes sure selections are announced in a screen reader. Copy list item text to button only when selection is made with enter/space key, or click (not arrow keys). That way it won't read aloud twice. - **Button element** - `[aria-haspopup="true"]` indicates button launches associated input - `[aria-controls="_listID_"]` links button to options list - Needs unique ID for pairing with list - **Unordered list** - [`role="menu"`](http://www.w3.org/TR/wai-aria/roles#menu) to communicate purpose of list - `aria-labelledby="_buttonID_"` to pair with button element - `aria-expanded="true | false"` to indicate when associated panel is expanded - Unique ID for pairing with button - `tabindex="-1"`to script focus but remove from tab order - **Child list items** - [`role="menuitem"`](http://www.w3.org/TR/wai-aria/roles#menuitem) on each child item - `tabIndex="-1"` for scripting

Resources

- [WAI-ARIA Listbox](http://www.w3.org/TR/wai-aria/roles#listbox) - [Using "listbox" and "option" roles vs. "menu" and "menuitem"](http://www.marcozehe.de/2014/03/11/easy-aria-tip-7-use-listbox-and-option-roles-when-constructing-autocomplete-lists/)

ajoslin avatar Sep 17 '14 13:09 ajoslin

Hi,

While using name attribute with md-select, I get the error Cannot read property '$name' of undefined. Everything works fine if I remove the name attribute from md-select. But if I do that, I cannot use form validation as it requires the field to have the name attribute. Any help on this?

sagunpandey avatar Jun 14 '15 05:06 sagunpandey

@DmitryEfimenko @adonix please open a new bug. This issue is closed.

@vivekimsit Please ask those kinds of questions on the forum. You should be able to add a ng-click to a div surrounding the md-select and under the expanding/collapsing div and in the ng-click just do $event.stopPropagation() to keep it from getting up to the expanding/collapsing div.

@sagunpandey Please ask those kinds of questions on the forum.

Splaktar avatar Jun 20 '15 16:06 Splaktar

So, what's the status of the multiple attribute? It's not working.

vectorderivative avatar Aug 07 '15 01:08 vectorderivative

md-multiple

ajoslin avatar Aug 07 '15 05:08 ajoslin

Oh... Docs lists it as just multiple. Okay then. Thanks.

vectorderivative avatar Aug 07 '15 05:08 vectorderivative