[TextField] TextField doesn't support a custom selectInput
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Summary 💡
Select
has an input
prop that provide a custom input for select whereas TextField
has only variant
prop for choosing input view. It seems like inconsistency and TextField
“cuts” a possibility to customise Select
.
Current Behavior 😯
Select has an input
prop which is handled here
Here is fragment of Select.
const InputComponent =
input ||
{
standard: <Input />,
outlined: <OutlinedInput label={label} labelWidth={labelWidth} />,
filled: <FilledInput />,
}[variant];
Unlike in TextField only variant can be choosen.
const InputComponent = variantComponent[variant];
Expected Behavior 🤔
Input can be choosen in TextField like in Select in example above.
const InputComponent = input || variantComponent[variant];
Motivation 🔦
Use Select
inside TextField
in the same way as Select
separately.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
[TextField] TextField doesn't support a custom selectInput
Select has an input prop that provide a custom input for select whereas TextField has only variant prop for choosing input view. It...
Read more >MUI - Outlined select label is not rendering properly
Solution 1: Use TextField. This is what TextField is for. It uses FormControl and InputLabel internally and make sure they work well ...
Read more >ASP.NET Core Blazor forms and input components
The Blazor framework supports forms and provides built-in input components: ... Data Annotations Validator component and custom validation.
Read more >Events: change, input, cut, copy, paste
Let's cover various events that accompany data updates. Event: change. The change event triggers when the element has finished changing.
Read more >HTML attribute: readonly - HTML: HyperText Markup Language
The attribute is not supported or relevant to <select> or input types that ... and being disabled, so the readonly attribute does not...
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
Thank you for answering. Seems like
SelectField
as separate component probably resolve the problem, if custom component can be passed.Select already have this ability but agregate component TextField not.
It doesn’t work because all handlers such as
onChange
,onFocus
is passed to components invariantComponent
array.@AwK55 Oh thanks for providing these extra details. In this case, maybe the first proposal of Marija would be best, a new
input
prop, which provides the same DX as when using theSelect
component.