Components: Support hint text with select

Created on 2 Jan 2017  路  8Comments  路  Source: angular/components

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

<md-select ... >
    <md-option ... ></md-option>
    ...
    ...
    <md-hint>some hint text</md-hint>
</md-select>

What is the current behavior?

not supported

What is the use-case or motivation for changing an existing behavior?

A hint below the select box. This could be used (For example) as a validation message when the select is not selected. Behaviour similar to the component.

Which versions of Angular, Material, OS, browsers are affected?

Material2 v2.0.0-beta.1
Angular 2.4.1

P5 feature

Most helpful comment

Please don't forget md-error.

All 8 comments

Is there a recommended alternate way to handle error hints for md-select (e.g. required)?

@SherwinJames look the soluction of codef0rmer in this issue https://github.com/angular/material2/issues/2624

Can we have something like this
<div class="hint"> This is used as primary message</div>
Supported in Md-Select

Please don't forget md-error.

For md-error for md-select I've done something like this:

<md-error *ngIf="type.touched && type.invalid">
          <span class="error-small-text" *ngIf="type.errors.required">
             Company Type is <strong>required</strong>
          </span>
</md-error>
.error-small-text {
  position: relative;
  top: -18px;
  font-size: 0.8em;
}

+1 @makdeniss cool

This is done now that select goes in mat-form-field

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings