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

In my prototype I sent focus to the selected item and immediately back to the button for two reasons: to get it to announce and to scroll the list of items from the keyboard. Otherwise we may be able to use aria-live. I'd have to experiment with it.

marcysutton avatar Jan 31 '15 21:01 marcysutton

@ajoslin can you guys publish a 0.8.0-rc0 so we can start playing around with md-select and provide some feedback? I'm sure a lot of people have some suggestions and ideas for the directive.

ilanbiala avatar Feb 01 '15 04:02 ilanbiala

@ajoslin Thanks for md-select push. i have tried it and it works.

sunny9240 avatar Feb 02 '15 11:02 sunny9240

@ilanbiala I think this is only going to happen when all accessibility problems are gone. For now, you can clone the repository, switch branches and build it locally

gustavohenke avatar Feb 02 '15 19:02 gustavohenke

@gustavohenke the issue I have with not publishing is that it doesn't hurt. People are going to play around with it and report functionality bugs, but no one is going to implement it until 0.8.0 is formally released. So the accessibility issue seems pretty pointless and alphas or betas or rc's should really be published to get some feedback and prevent bugs in the real version.

ilanbiala avatar Feb 02 '15 21:02 ilanbiala

@ilanbiala My problem with that is that they may have more work they want to do with the component before releasing it (ie, I bet @ajoslin knows all of the bugs in the implementation right now, if applicable). Releasing it would be an exercise in futility because all those bugs would get reported back in. There's no sense releasing something that's not yet ready for it yet.

We all want it, but I think it's not unwise to wait a bit longer for it to be functional and have all of the structural kinks worked out before releasing it to the masses.

seiyria avatar Feb 02 '15 21:02 seiyria

@ilanbiala - Our master branch is a our internal development branch. If the component/source is in master but not yet released in a formal tag/release, then it should be considered still in development mode, You can report issues for these if really necessary/desired.

Please note, however, that issue reports for unreleased features and/or components can be both superfluous and overwhelming to the team.

ThomasBurleson avatar Feb 02 '15 21:02 ThomasBurleson

@seiyria A list of known issues would prevent duplicate issues and unnecessary submissions.

ilanbiala avatar Feb 02 '15 22:02 ilanbiala

I'm going to push what I have now to master tonight/tomorrow.

It's the complete Select, minus keyboard access, accessibility, and demos.

As you all have suggested, there is really no downside to pushing an early version.

If someone posts a duplicate issue we can just close it instantly saying "This component is a work in progress. We're aware."

I'll make a checklist of known issues in this issue before pushing.

ajoslin avatar Feb 02 '15 23:02 ajoslin

Yeah

luclanet avatar Feb 02 '15 23:02 luclanet

I think the downside is that people will use an inaccessible component. I don't think it should be in a release candidate without it. Not to mention release candidates are for more than just one component.

marcysutton avatar Feb 03 '15 05:02 marcysutton

@marcysutton upgrading from whatever it will be called (alpha/beta/rc) to the official version will be pretty easy, and in any event whatever other dropdown I pick to use instead will also not be accessible (probably even less so), so whatever is built in is almost guaranteed to be much better than whatever else I will use in terms of accessibility.

ilanbiala avatar Feb 03 '15 17:02 ilanbiala

@ajoslin is it available now? because i can't find it on materialjs demos nor in a repository search

onerinas avatar Feb 08 '15 10:02 onerinas

It seems that it was in master not quite a day and then it was removed again. Any new information on this? Thanks a lot!

rryter avatar Feb 11 '15 14:02 rryter

It is not ready, so we removed it from master ahead of the 0.8.0-rc1 release. It will be added back in as soon as we get it more stable.

marcysutton avatar Feb 11 '15 16:02 marcysutton

Hi! I think that i could be very useful to have a something like the ng-change in this component.

Jarlakxen avatar Feb 11 '15 18:02 Jarlakxen

+1

fabioginzel avatar Feb 11 '15 20:02 fabioginzel

This plus multi select ++1

blarsen06 avatar Feb 12 '15 02:02 blarsen06

+1

gogromat avatar Feb 13 '15 01:02 gogromat

+1

ask007learning avatar Feb 13 '15 17:02 ask007learning