focus loses after each keyboard input for custom TextFieldComponent
See original GitHub issueOverriding TextFieldComponent forces losing focus after each keyboard input
return (
<TextField
{...props}
value={formattedValue}
onChange={event => setFormattedValue(event.target.value)}
/>
);
}}
Live example
Sandbox example https://codesandbox.io/embed/datepicker-y0dn7
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
focus loses after each keyboard input for custom ... - GitHub
Overriding TextFieldComponent forces losing focus after each keyboard input return ( setFormattedValue(event.target.value)} /> ); }} Live ...
Read more >How to make focus stable for custom text field material-ui ...
The problem is in your TextField onChange function. If you remove this attribute, you will see it stops losing focus.
Read more >How to Use the Focus Subsystem - Oracle Help Center
For more details see Customizing Focus Traversal. A component must to be prevented from losing focus, or you need to check a value...
Read more >Initializing focus state in React: you might be doing it wrong
But the element is focused, so our initial hasFocus state of false is wrong! To simulate this, I've delayed the hydration of the...
Read more >React Text Field component - Material UI - MUI
The TextField wrapper component is a complete form control including a label, input, and help text. It comes with three variants: outlined (default), ......
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
Solution https://github.com/mui-org/material-ui-pickers/issues/1388
So simple. Thank you @dmtrKovalenko @De-Santa it works for me