Reputation: 902
I have a issue with DateTimePicker from Material UI. After page reload it loses it's initial padding of 10px for each side.
Once component is rendered for the first time it looks like:
Once I reload the page it looks like:
I have inspected it in dev tools and it's this element:
And I found in dev tools 2 classes where I change padding to 10px ( in dev tools ) it works perfectly .MuiInputBase-input .MuiInputBase-root
But once I put those valuse into the code it doesn't work.
export const StyledDateTimePicker = styled(DateTimePicker)`
& .MuiInputBase-root {
padding: 10px;
}
& .MuiInputBase-input {
padding: 10px;
}
`;
Can You please let me know how to apply those props to the input ? I'm using StyledComponentes in the project.
thanks a lot !!!
Upvotes: 0
Views: 298
Reputation: 1301
This is most likely caused by incompatible Mui versions. Try getting rid of @mui/lab
and install @material-ui/pickers
instead. https://material-ui-pickers.dev/getting-started/installation
Alternatively, migrate all your components to the new version of Mui.
Upvotes: 1