Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text input with label and placeholder issues #7821

Closed
robert-figshare opened this issue Aug 18, 2017 · 7 comments
Closed

Text input with label and placeholder issues #7821

robert-figshare opened this issue Aug 18, 2017 · 7 comments
Assignees
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!

Comments

@robert-figshare
Copy link

robert-figshare commented Aug 18, 2017

Problem description

If you set a multiline TextInput with placeholder and label, both will be visible and overlapped
If you set a TextInput with multiline={false} and InputLabelProps={ { shrink: true } }, The placeholder will be displayed only on focus

Steps to reproduce

You can find the configurations here.
https://www.webpackbin.com/bins/-KrocGNyPTqG5mMTl4q6

Versions

  • Material-UI: beta-5
  • React: 15.4.2
  • Browser: Chrome
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! v1 labels Aug 18, 2017
@oliviertassinari
Copy link
Member

It could be an higher order Component issue, where the parent component doesn't have access the the textarea value. I'm just guessing. I haven't looked into it.

@robert-figshare
Copy link
Author

After this update, when using { shrink: true } the placeholder is broken in every case. It only appears when focusing the input.
https://www.webpackbin.com/bins/-KrocGNyPTqG5mMTl4q6
Is there any way to use skrink label with a placeholder?

@oliviertassinari
Copy link
Member

@robert-figshare I do think that it's different. It's a feature this time. I guess we could add a property like alwaysDisplayPlaceholder or think of a smarter way to handle the shrink state with the focus state.

@robert-figshare
Copy link
Author

robert-figshare commented Sep 5, 2017

It just looks really weird, you have an empty input, no placeholder. When you click the input the placeholder appears.
When you add shrink: true to the label, it become fixed above the input. It looks normal for me that, if the label is fixed, the placeholder should always appear.

label:not(.shrinked) + $formControl & { opacity: 0.5 }

@oliviertassinari
Copy link
Member

Yes, it's weird. My fixes what about making the single and multi lignes mode working the same.

@Floriferous
Copy link
Contributor

I'm experiencing this, should we reopen the issue?

@oliviertassinari
Copy link
Member

@Floriferous Please open a new issue with more detail :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants