I have a KeyboardDatePicker with a custom style:
import { MuiPickersUtilsProvider, KeyboardDatePicker } from '@material-ui/pickers';
const datePickerTheme= outerTheme => ({
overrides: {
MuiFormControl: {
marginDense: {
marginTop:"0px"
}
},
MuiInputAdornment: {
positionEnd: {
marginLeft: "0px"
}
}
}
});
<ThemeProvider theme={datePickerTheme(originalTheme)}>
<MuiPickersUtilsProvider utils={DateFnsUtils} >
<KeyboardDatePicker
variant="inline"
format="dd/MM/yyyy"
margin='dense'/>
</MuiPickersUtilsProvider>
</ThemeProvider>
It works well, but I'm trying to reproduce the same customization without having to nest the picker inside a theme. I've tried using the InputProps property:
<KeyboardDatePicker
variant="inline"
format="dd/MM/yyyy"
margin='dense'
InputProps={{classes: {
MuiFormControl: {
marginDense: {
marginTop: '0px'
}
},
MuiInputAdornment: {
positionEnd: {
marginLeft: "0px"
}
}
}
}}/>
But that does not work.
Is it possible to achieve the customization via classes,inputProps or any other method without resorting to theming or global rules?