add floating label to md-select
When an md-select has a value, the placeholder should be used as a floating label to keep consistent with the md-input directive
Regarding to behavior of this material element, this kind of menus appear above all other in-app elements and floating labels relevant only for input elements. For more understanding look into "Do not" section in component behavior.
Actually I think it should be an option. If you look at the single-line text fields example in the design spec, there are selects with values both with and without floating labels. Perhaps an explicit <md-select-label> could float, and a placeholder attribute would not?
I'd almost suggest the other way round @marcysutton. If a placeholder is defined within the md-select this is the default value displayed when nothing has been selected. the md-select-label is used when you want to transform a key/value pair from key to value.
e.g, in a simple md-select placeholder="Country" when nothing has been selected the placeholder shows 'Country', when a value has been selected the placeholder floats and the selected value (or md-select-label) is displayed in the main content section.
It seems to me you're referring to the label at the top of the selected option,as shown here: Simple menus (see the "Simple menus" section)
I agree with this. But if you need a simple <label> inside the md-select, try the second example at material.angularjs.org:
<md-optgroup label="Country">
But anyway, you describing different element. As stated in the specification "Menus are positioned over their emitting elements such that the currently selected menu item appears on top of the emitting element. " . And floating label will not be visible until the menu is open. The element you looking for is the label and the predefined option below.
I think we may be talking at cross purposes, so here is an example. Imagine an app where a user is arranging travel and they have to select the departure and arrival countries...

Once the countries are both selected it is no longer clear to the user which is the departure and which is th arrival country as the labels (placeholders) are no longer visible...

Once an option has been selected, it would be great for the placeholder to float in the same way as the md-input-container to make it clear to users what the field is they have selected
In most cases, these elements have a label or icon on the sides. Or in another case, the input field that indicates the purpose of adjacent elements. The input "New York" represents value in select-box.
Speaking specifically about the material components. For those occasions when we need to show at once the category/type name and value, you must use another element which has a different look, but performs much the same function:

I agree with @marcysutton that it should be an option.
When used within a form as a "select", a floating label is necessary so that it looks like other "input" element within the form.
However, when used as a "menu" (e.g.: in a toolbar), a floating label might not be necessary.
@sebastiengiroux - thanks, this is exactly what is needed. To make a form consistent it should be possible to put a floating label on the md-select directive.
One thing to highlight though with regards to @marcysutton suggestion.
the md-select-label is a great tool to transform the displayed value, I would suggest this is only ever used to display the selected value, transformed as required. The placeholder attribute on the md-select itself it the one to float as this is what describes the content of the select.

+1 Select and it's multiple variant, are common form items. It would be nice to have the consistent floating label to match inputs and 100% width. I imagine it could be accomplished by a wrapper div, similar to how the md-input-container interacts with md-input.
+1
I agree with @hodeyp that "the md-select-label is a great tool to transform the displayed value".
I think that we could achieve the floating label by wrapping the "md-select" within a "md-input-container" (as mentioned by @mtraynham), and still keep the "md-select-label".
Good discussion here. We certainly need to have our selects in forms with inputs and they should be able to be side-by-side with a similar look.
It would be great to also have a way to make an input looking like md-autocomplete, with the clear button on the right, but without actually using the auto complete features.
Or simply make md-autocomplete working when md-items is not defined ... Currently i have to write :
<md-autocomplete md-items='item in []'/>
It could be used for example to filter elements in a list, or others features where an input is used outside of an usual form.
When is this enhancement getting released? Any idea ?
As a temporary workaround to the floating label issue, I was able to get md-select to look similar to an input with a value inside of md-input-container using the master branch by adding this css to my application:
md-input-container > md-select {
flex: 1;
order: 2;
margin: 0;
}
And adding the md-input-has-value class to the md-input-container:
<md-input-container class="md-input-has-value">
<label>Something</label>
<md-select>...</md-select>
</md-input-container>
It doesn't perform the animations when a select has no value and I haven't tried integrating ng-messages yet, but this is something anyway.
@mzbyszynski Thanks for alluding to that. To expand on your temporary workaround, you could probably ng-class the md-input-has-value which is only enabled when you have a value set. Maybe something like:
<md-input-container ng-class="{'md-input-has-value': foo.bar}">
<label>Something</label>
<md-select ng-model="foo.bar">...</md-select>
</md-input-container>
I'm under the impression that md-select could rely on md-input-container as a required parent controller, just as input and textarea do. The main difference here is the existence of md-select-label and if that conflicts with an already existing label.
https://github.com/angular/material/blob/master/src/components/select/demoBasicUsage/index.html#L15
Also one thing to point out, the animation is probably unnecessary because the menu pop-up will cover the full length of the form field.
I altered @mzbyszynski's solution to get it working. One unresolved issue, when no value is selected, the md-input-label has to have a value to retain height (with an inserted span). I just set the value to empty.
// less here
md-input-container {
// largely copied from md-input
md-select {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-order: 2;
-ms-flex-order: 2;
order: 2;
display: block;
background: none;
padding: 11px 2px 1px;
border-width: 0 0 1px 0;
line-height: 26px;
-ms-flex-preferred-size: 26px;
border-radius: 0;
margin: 0;
}
&.md-input-has-value {
md-select {
padding: 0px 2px 1px;
}
}
}
<md-input-container ng-class="{'md-input-has-value': user.roles && user.roles.length}">
<label>Roles</label>
<md-select multiple ng-model="user.roles" placeholder="Roles">
<md-select-label>{{ user.roles.length ? user.roles.join(', ') : '' }}</md-select-label>
<md-option ng-value="role" ng-repeat="role in roles">{{ role }}</md-option>
</md-select>
</md-input-container>
@mzbyszynski I am trying the workaround suggested, but the label is under the md-select. Here a plunker http://plnkr.co/edit/aBdqOHKnbw1tkpcWCusI?p=preview Could you help me to solve it?
Looking forward to a milestone.