Skip to content

Bug: input placeholder is not displayed on field reset after editing #2489

Closed
@Parez

Description

@Parez

Bug: if the input field is cleared with reset after being changed, the placeholder is not displayed. Feels like it should if the field is empty and marked as untouched.

Following steps to reproduce:

Using reactive forms.

  1. Create an input field (md-input) with placeholder set to some text inside md-input-container .
  2. On some event (e.g.) checkbox selected - reset the input.
  3. Now two cases:
    1. If placeholder is floatingPlaceholder it stays above (though should go down if field is reset)
    2. If placeholder is not floatingPlaceholder it is not displayed at all (though it should be)

I was making a form where the input should get cleared and disabled once checkbox is selected. And default value (e.g. placeholder) should be displayed instead of the text in the input. Spent all day trying to figure out how it can be solved. Didn't find a way.

"@angular/material": "^2.0.0-beta.1", Chrome

The other thing which also feels as quite weird behaviour:
When input is programmatically disabled via reactive forms, the border is not becoming dotted. The same setup as above.
screen shot 2017-01-01 at 22 16 23

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions