Skip to content

fix(MdInput): placeholders don't float when MdInput value has bound expression #2477

@0x-r4bbit

Description

@0x-r4bbit

Bug, feature request, or proposal:

When binding a value to MdInput using an expression, placeholder attribute (or md-placeholder) don't float when value is set, which results in placeholder text + input value to overlap. Also after focussing and blurring the input, the placeholder goes back to its original position. However, when using a static value, it works perfectly fine.

What is the expected behavior?

placeholder attribute (and/or MdPlaceholder) should float, also when initial MdInput value comes from an expression.

What are the steps to reproduce?

  1. Create a property on component (foo="bar")
  2. Bind property to MdInput and give it a placeholder (placeholder="Some Placeholder")

Here's a Plunk that reproduces the bug: https://plnkr.co/edit/NnwmYrakshZ5DEBkW27D?p=preview

Is there anything else we should know?

There's an issue that might be related to this bug. When setting form values programmatically, placeholder positions also aren't updated. This issue can be found here: #2441

Someone came up with a fix for that as well: crisbeto@72bc742

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