Skip to content

md-select doesn't reset placeholder effectively "clearing" selection #2634

@skeize

Description

@skeize

It's entirely possible I'm not doing things right, but... the placeholder within the md-select doesn't appear to be resetting from it's floating position after selecting an empty md-option.. effectively clearing the selection.

Here's what I've got:

    <md-select name="thing" placeholder="Thing" formControlName="thing">
        <md-option></md-option>
        <md-option *ngFor="let t of things" [value]="t.id">{{t.name}}</md-option>
    </md-select>

My form/controls are defined as follow:

    thing = new FormControl(null, Validators.required);

    this.editForm = new FormGroup({
        thing: this.thing,
        ...
    });

When initialized with a null value, the placeholder appears as it should, after choosing an option, then choosing the empty option (), the form control's value is set to null, however the placeholder doesn't leave the floating position.

I've also tried setting the empty option's value to null (<md-option [value]="null">) with no success.

I'm using Chrome on Windows 10.
Angular 2.4.3
Material 2.0.0-beta.1

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions