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

[TextField] applying style height doesn't move all the elements properly #835

Closed
jhanink opened this issue Jun 13, 2015 · 6 comments
Closed
Labels
bug 🐛 Something doesn't work

Comments

@jhanink
Copy link

jhanink commented Jun 13, 2015

choosing a shorter height to collapse the space between multiple vertically listed fields doesn't reposition the label, floating text label or input correctly

<div>
        <div style={this.style}>
          <TextField
            hintText="Please enter your first name"
            floatingLabelText="First Name"
              style={{border:'1px solid green',height:'40px'}}/>
        </div>
        <div style={this.style}>
          <TextField
            hintText="Please enter your middle name"
            floatingLabelText="Middle Name"
            style={{border:'1px solid green'}}/>
        </div>
        <div style={this.style}>
          <TextField
              hintText="Please enter your last name"
              floatingLabelText="Last Name"
              style={{border:'1px solid green'}}/>
        </div>
      </div>

text-field-jh1
text-field-jh2

@hai-cea hai-cea changed the title TextField: applying style height doesn't move all the elements properly [TextField] applying style height doesn't move all the elements properly Jun 19, 2015
@shaurya947
Copy link
Contributor

I know we also have props for floatingLabelStyle and hintStyle. However, after some tinkering around, I haven't been able to get this use case working successfully using only those props (in a non-hacky way of course).

cc: @oliviertassinari do you also wanna take a look at this? I feel like some code would need to change in the TextField source..

@oliviertassinari
Copy link
Member

We have kind of the same issue when we change the font size.
The component is using absolute value, it wasn't design with this concern in mind.
I'm wondering if flex box couldn't make our life easier here.

@alitaheri alitaheri added the bug 🐛 Something doesn't work label Dec 8, 2015
@djmccormick
Copy link

This is causing me pain as well.

@Dreculah
Copy link

It's nasty, but until we get something better in place, I'm using negative top margin:

  floatingLabelStyle={{
        marginTop: -10
  }}

@tintin1343
Copy link
Contributor

I hope the above solution helps for now. TextField requires a re-write to do away with the styling issues.

I am closing this issue for now. If someone who has this issue does not gets help from the above solutions, please leave a comment below.

@Keagnn
Copy link

Keagnn commented Jul 17, 2018

.MuiInput-input-25 {
padding: 25px 0px 8px;
}

@mui mui locked as resolved and limited conversation to collaborators Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

8 participants