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

Text field with fixed label; no animation when the input field on focus #201

Closed
scarletsky opened this issue Aug 27, 2014 · 5 comments
Closed
Assignees
Milestone

Comments

@scarletsky
Copy link
Contributor

In fact, what I want is like this:
material text field

It seems that I can not use <label> tag because of the animation. I can just work around with other tag like <p>, <div>.

<material-input-group class="material-input-group-theme-light" layout="horizontal">
    <p flex="30">123123</p>
    <material-input type="text" 
                    ng-model="user.fullName"
                    flex="70"
                    style="display: inline-block;"
                    placeholder="please input something"></material-input>
</material-input-group>

For the semantic of HTML, I think it will be better if we support a way to remove the label animation.

@ThomasBurleson
Copy link
Contributor

Very interesting and often missed aspect of component - UX with error states.
Can you explain more what you mean "cannot use <label> tag due to animation ?

@scarletsky
Copy link
Contributor Author

@ThomasBurleson
It means I don't need the focus animation if I use the layout above. But if I use <label> tag in <material-input-group>, the animation will trigger.

I think we can add .no-label-animation in https:/angular/material/blob/master/src/components/form/_form.scss , so when I don't need the label animation, I can add .no-label-animation class to the <material-input-group>.

@jnishiyama
Copy link

@scarletsky I simply use a placeholder to get around the animation issue, works like a charm (needs some styling done though). It does seem like it could be useful to have a no animation class on the label...

@ThomasBurleson
Copy link
Contributor

Please note that the current Text Field component is a Floating Label component that is specified (by Material Design) to have a hint/label animation. There are several other implementations of Text Field that will be arriving in the near future (some without animation).

BTW - it appears that the workarounds above - perhaps suitable for your needs - are changing the way Floating Label Text fields should work.

@WillsB3
Copy link

WillsB3 commented Nov 6, 2014

+1 to this. I also need a regular (non-floating-label) text field.

@ThomasBurleson ThomasBurleson changed the title support a way to remove the label animation when the input field on focus? Text field with fixed label; no animation when the input field on focus Nov 13, 2014
@ThomasBurleson ThomasBurleson added this to the 0.8.0-rc1 milestone Nov 13, 2014
@ajoslin ajoslin added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Feb 4, 2015
@robertmesserle robertmesserle added resolution: fixed and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Feb 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants