[TextField] Add "input" property for custom Input component
See original GitHub issueLike Select does, It’d be useful to allow TextField to receive a custom Input component.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
Passing a custom Input element via the input
prop.
<TextField
label="Name"
input={<CustomInput name="amount" id="amount-simple" />}
/>
Current Behavior
Having to stick to the default Mui Input
<TextField
label="Name"
/>
Context
My custom Input shows a specific icon depending on the error
prop
Your Environment
Tech | Version |
---|---|
Material-UI | 1.0.0-beta.31 |
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
[TextField] Add "input" property for custom Input component
Passing a custom Input element via the input prop. <TextField label="Name" input={<CustomInput name="amount" id="amount-simple" />} / ...
Read more >React - Material UI - TextField controlled input with custom ...
InputProps : This provides properties to the Material UI component that is selected based on the variant property i.e. OutlinedInput , ...
Read more >React Text Field component - Material UI - MUI
Text Fields let users enter and edit text. Text fields allow users to enter text into a UI. They typically appear in forms...
Read more >Create and style a text field - Flutter documentation
TextField is the most commonly used text input widget. By default, a TextField is decorated with an underline. You can add a label,...
Read more >How to Create Your Own React Text Field | brettfisher.dev
import React from 'react'; const TextField = () => { return <input />; }; export default TextField;. Test it out in your App.tsx...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alltom You can already do it this way:
We should minimize as much as possible the API surface. I don’t think that adding a
inputComponent
component to the TextField will be wise. At some point, we removedinputProps
too. But people were complaining about it as it’s a common use case. I don’t think we are in a common use case here. Thanks for raising this point 👍 .@rastegars Did you get the
CustomInput
to show on the screen? I couldn’t get mine and also my customInput
component doesn’t show the auto suggestion list.EDIT. Got the custom
Input
component to show with