Input component destroys muiFormControl context which breaks complex components
See original GitHub issueI have a react-select
component wrapped into FormControl
and Input
according to the explanation on your website. I think I added FormControl
myself to control the behaviour of Label
which I added to make it resemble all the other input components.
So a component which wraps react-select
and is provided as inputComponent
to Input
triggers onBlur
and onFocus
from muiFormControl
context in order to control the behaviour for Select
.
However this context is not propagated any longer down the line.
Because FormControl
doesn’t accept focused
as an argument, controlling it’s state of focus is impossible in this case now
Is it possible to make Input
behaviour in part where it erases the context optional?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Input component destroys muiFormControl context ... - GitHub
Input component destroys muiFormControl context which breaks complex ... There are two main components: SelectField (the root component) and ...
Read more >Material Form Field and TextFieldRoot overwrite theme with ...
You are passing procedureStyles.textField via the input key of the classes prop in InputProps . That targets the innermost input element (and I ......
Read more >Design Patterns with React Easy State | by Bertalan Miklos
React Easy State is a transparent reactive state management library with two functions and two accompanying rules. Always wrap your components with view()...
Read more >youtube-danmaku - Source code - Greasy Fork
Consistency between these values is important. background: { paper: common.white, ... i < parts.length; i++) { scoped += scope + " " +...
Read more >Free Automated Malware Analysis Service - powered by Falcon ...
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
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
Thanks for the gist. Hopefully, It will help someone in the community.
Hello Olivier Thanks for information regarding
shrink
, I didn’t know about itYesterday I have solved the problem by separating
<Input inputComponent... />
into a separate component which reads context and managesmuiFormControl.onDirty
andonClean
itself, instead of relying on the underlying component (SelectWrapped) to do so, as the latter doesn’t have that context any longer.Maybe this (still a bit messy) file will be of any use: https://gist.github.com/iamdanthedev/2a70e95d8964979f689721a34b2d15b3
(L255-264)
Thanks!