MUI avoid helperText to change width of input field - reactjs

I am using the helpertext of the mui textfield component to display validation errors. Unfortunately the helpertext is increasing the width of the textfield. I am using the "fullWidth" attribute.
If there is no error, no helper text is shown (image 1). If input validation fails, error is shown but the the textfield should remain the same size (image 2).

I had the same problem with GWT MaterialTextBox. I managed to solve my problem by setting a fixed width (e.g. 300px) for the text box.

Related

MUI TextField(multiline) having a helper text and characters remaining limit

I am trying to make a textarea component with MUI and I have got the following designs -
Design - 1
Desgin - 2
I don't think they can be achieved in any way with the TextAreaAutosize of MUI -
https://mui.com/base/api/textarea-autosize/
I have seen MUI Textfield multiline prop maybe I can use that because I will have a helperText to at least achieve something from the design like in the codesandbox -
https://codesandbox.io/s/prod-butterfly-dl1xil?file=/demo.tsx
Will it be the right solution???

Error message affects the height of the text field - helperText material UI

I have a react hook form. After validation, the error message make my text field moves up.
how it looks
Here is how helperText setup:
<TextField
helperText={invalid && error}
/>
After validation, the error message will appears with the help of helperText. Then the textField will be shift up.
Is there any way I can make the error message does not affect the height of the textField?
I am really appreciate.
You can handle this by setting a default value of " " (A text that has only space typed in it) to your helperText in the component. This way the height is already allocated for the text and will remains the same whether there is an error or not.

MUI TextField size growing through div transition

I'm making a sidebar for my project and I'm using div transitions to give a smooth effect on collapse. However I have Material-ui (v4.12.3) TextField inside, and during the transition of opening the div, the height of the text field changes to 496px. Adding maxHeight style doesn't prevent a limit and once you interact with the field, it returns to normal (16px). Has anyone had this interactions with transition and mui text fields before?

How to get scroll height of multine textField (office ui fabric react)

I am trying to get the scroll height of the multi-line text field. I have used office UI fabric react TextField.
I have tried to get the TextField scroll height in the ComponentDidUpdate() /jQuery, but it always returns scrollHeight as 0.
AutoHeightAdjust property works fine when I am entering input in the TextField. But, when I am trying to show the data from the state in the TextField it does not fit to the size of the content. That's where the real problem is.
This is my tag:
<TextField disabled={this.isDisabled} autoAdjustHeight value={this.state.Action} onChanged={this.handleAction} multiline resizable={true} rows={6}/>

What controls the height of a text field in Ext JS?

I've been trying to adjust the height of my combo field. I have tried several different methods, including setting config properties on the combo and its container, tweaking css, and using css mixins. So far, I have had no effect on the height of the combo.
I'm using Ext 6 and the Triton theme.
Specifically, I want the combo box (in certain situations) to look just as it does out-of-the-box, except less white space around the value in the textfield, thus making the label and textfield consume less vertical space.

Resources