Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-input-container label and placeholder bug #1279

Closed
ilanbiala opened this issue Jan 24, 2015 · 17 comments
Closed

md-input-container label and placeholder bug #1279

ilanbiala opened this issue Jan 24, 2015 · 17 comments

Comments

@ilanbiala
Copy link
Contributor

When you have markup like this:

<md-input-container>
        <label>Email</label>
        <input type="email" placeholder="johnny.appleseed@gmail.com" required="required" autofocus="autofocus" ng-model="email">
</md-input-container>

You end up with
screen shot 2015-01-24 at 1 50 08 pm
and
screen shot 2015-01-24 at 1 50 13 pm
The label covers the placeholder. What should be done about this?

@ajoslin
Copy link
Contributor

ajoslin commented Jan 24, 2015

Thanks. The input's placeholder will now animate in when the input is focused and does not have a value.

@ajoslin
Copy link
Contributor

ajoslin commented Jan 24, 2015

Check out the 'First Name' input: https://material.angularjs.org/#/demo/material.components.input

@ilanbiala
Copy link
Contributor Author

@ajoslin quick fix, nice. It would be awesome to include this in 0.7.1. Are you guys open to docs suggestions?

@ajoslin
Copy link
Contributor

ajoslin commented Jan 25, 2015

More open than you know. @marcysutton is working on a redesign now to make them more usable.

@marcysutton
Copy link
Contributor

Totally open to docs suggestions, especially for the API and demos. 👍

@ilanbiala
Copy link
Contributor Author

@marcysutton for the input docs page, I would make it less of a general page and more like "Here's what the placeholder attribute usage looks like" with a demo and then the code after. Have much more specific examples helps understand how each piece works.

@yinhm
Copy link

yinhm commented Jan 26, 2015

I have noticed this break the peace with Angular UI Bootstrap.

I will migrate to angular-material in the end, but right now there are features have not been implemented, eg: typeahead.

          <form class="navbar-form navbar-right" role="search" ng-controller="SearchController" ng-submit="submit()">
        <div class="row">
          <div class="col-lg-12">
        <div class="input-group">
                  <input type="text"
                         class="form-control" 
                         placeholder="Search symbol..."
                         name="q"
                         autocomplete="off"
                         spellcheck="false"
                         ng-model="selected" 
                         typeahead="symbol for symbol in symbols | filter:$viewValue | limitTo:8"
                         typeahead-on-select="submit($item)"
                         />
          <span class="input-group-btn">
                    <button class="btn btn-default" type="submit">Search</button>
                  </span>
                </div>
              </div>
            </div>
          </form>

@ghost
Copy link

ghost commented Jan 29, 2015

nice fix. I upgraded to master and this works like a charm.

@vovafeldman
Copy link

I'm using angular 1.4.4 and angular-material 0.11 and still have the issue. Here's the HTML:

        <md-input-container flex>
            <label>Email address</label>
            <input type="email"
                   ng-model="addresses[p.id]"
                   ng-model-options="{ updateOn: 'blur' }"
                   placeholder="{{ p.email }}" />
        </md-input-container>

That's on focus:
image

That's without focus:
image

@jayj
Copy link

jayj commented Sep 22, 2015

@vovafeldman What if you use md-placeholder instead of placeholder. Does that change anything?

@vovafeldman
Copy link

md-placeholder doesn't seem to work at all:
image

@topherfangio
Copy link
Contributor

@vovafeldman This should be fixed by #4623. Can you try again with the latest master code?

Also, we updated the inputs demo so that the Postal Code input uses both a label and placeholder as an example.

@vovafeldman
Copy link

Where can I find the concatenated master file?

@vovafeldman
Copy link

Indeed - it works with the master! I guess the fix isn't merged to 0.11.

@topherfangio
Copy link
Contributor

@vovafeldman Indeed, the fix was pretty recent. Should be available in 0.11.1 which should be landing soon.

@imVinayPandya
Copy link

@topherfangio @kara guys please look at this placeholder issue.

angular/components#2661 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants