Overriding TextFieldComponent forces losing focus after each keyboard input
TextFieldComponent={props => {
return (
<TextField
{...props}
value={formattedValue}
onChange={event => setFormattedValue(event.target.value)}
/>
);
}}
Sandbox example https://codesandbox.io/embed/datepicker-y0dn7
You must call props.onChange on textfield change. But the issue is that you are changing the datepicker value on each keystroke. It forces to reapply value
https://codesandbox.io/embed/datepicker-y0dn7
So there is no way to pass a value to custom TextFieldComponent?
Ohh god you are using v2. We are not supporting it
In v3 you can use inputValue and pass any string from the root of <KeyboardDatePicker />
I still can't understand how to make it work
Having same issue as @bjutkoski .
@dmtrKovalenko can you provide more details or example please?
So simple. Thank you @dmtrKovalenko
@De-Santa it works for me
Most helpful comment
Solution https://github.com/mui-org/material-ui-pickers/issues/1388