[TextField] Error Styles on errorText below textfield not working
errorStyle on textfield not working as expected
Versions
- Material-UI: 0.17.4
- React: 15.4.0
- Browser: chrome 57
Description
The div of the error text doesn't affects the elements below it.
Expected behavior
If the height is 50px then the elements below this should move down but currently it behaves like the position is absolute.
<TextField
hintText="Enter name"
errorStyle = {{
marginBottom:'50px',
height:'20px',
fontSize:'50px'
}}
/>
@kamleshchandnani The errorText container has a relative position. These components are built with Material Design in mind, and a fontSize of 50px is well outside the range of usable errorText.
https://material.io/guidelines/components/text-fields.html#text-fields-layout
Are you able to use smaller text to make this work within those guidelines?
@m2mathew

So 50px was just an idea the goal is that errorText div occupies the space below it even though when the error is not displayed. ideally the case should be that when an error is displayed then that div should be displayed and move other elements down to incorporate the space.
So in the first image the last name field is moved slightly down when the error is there else the space is not reserved for the error div it is display:none. want to achieve something like this.
We have been porting the component on the next branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it.
I can't find documentation on how to fix this bug, cause now it has the same behaviour... (Text Fields and labels of the form are jumping under the field with error). All I really need is to make MuiFormHelperText(which is inside of TextField) positioned as absolute with the bottom prop to zero + TextField will have some kind of margin-bottom. How can I do this on the TextField component?
@danielkolesnik did you find a solution for the problem that you mentioned?