Components: md-input-container: floating placeholder should be at the left edge of the input, even if prefix is present

Created on 17 Mar 2017  路  8Comments  路  Source: angular/components

Proposal:

When an input's placeholder floats, it should line up at the left edge of the input underline. It already does this, except for when a prefix is present, in which case it lines up at the end of the prefix.

What is the current behavior?

https://plnkr.co/edit/vQRVgYLGXw7cISY3g0cm?p=preview

What is the expected behavior?

Desired behavior is for "Example" (the placeholder) to align with the start of "http://" (the prefix) in the above example.

P2

Most helpful comment

Looks like a bug.

All 8 comments

Looks like a bug.

I don't think its necessarily obvious what's the right behavior in this case. It does look strange in the example provided, but when the placeholder isn't floating it should come after the "http://" do we want it to shift left and up in this case when it floats? also in some cases (e.g. icon prefix) floating above the infix looks natural. see: https://plnkr.co/edit/RUPZeyuz1HXbdopNnRvI?p=preview

For comparison, angular dart does the same thing we do. Polymer does the "shift left and up" thing, which looks kind of weird: https://www.webcomponents.org/element/PolymerElements/paper-input/demo/demo/index.html (part of the weirdness is due to the fact that it seems to instantaneously jump left as it animates up, but even if it were properly animated you'd still have the label crossing through the prefix which would look strange).

@jelbourn

@mmalerba yeah, the polymer animation doesn't look great. What if we transform up and then left in sequence instead of at the same time?

It looks bad - really bad - in a list of inputs where the labels are 'always' floating and each input has a different prefix or some have no prefix: http://plnkr.co/tiBos98s7cX9Lz0cCVQu. This is the main problem as I see it - as I stated in #4428.

The Polymer animation from float to inline looks okay - it goes right then down. So up then left is probably the way to go. Why Polymer did left then up I don't get - but it isn't horrible.

Closing in favor of #7645

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

Related issues

michaelb-01 picture michaelb-01  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

RoxKilly picture RoxKilly  路  3Comments

kara picture kara  路  3Comments

xtianus79 picture xtianus79  路  3Comments