Skip to content

Commit 7cb21fd

Browse files
committed
fix field size for date picker
1 parent 4c3cb8d commit 7cb21fd

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

src/ui/screens/question-pages/components/input-types/ProfileInputDate.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const ProfileInputDate = ({ t, value, setValue, error }) => {
1010

1111
const handleChange = (newValue) => {
1212
if (newValue && dayjs.isDayjs(newValue)) {
13-
setValue(newValue.format('YYYY-MM-DD'));
13+
setValue(newValue.format('YYYY-MM-DD'));
1414
} else {
15-
setValue(null);
15+
setValue(null);
1616
}
17-
};
17+
};
1818

1919
return (
2020
<>
@@ -24,15 +24,23 @@ const ProfileInputDate = ({ t, value, setValue, error }) => {
2424
label={t('app.datafields.pickBday')}
2525
value={value ? dayjs(value, 'YYYY-MM-DD') : null}
2626
onChange={handleChange}
27-
sx={{
28-
'& .MuiInputLabel-root.Mui-focused': {
29-
color: 'blue.main',
27+
slotProps={{
28+
textField: {
29+
sx: {
30+
minWidth: (theme) => `calc(${theme.typography.pxToRem(8 * t('app.datafields.pickBday').length)} + 60px)`,
31+
},
3032
},
31-
'& .MuiOutlinedInput-root': {
32-
'&:hover fieldset': { borderColor: 'blue.main' },
33-
'&.Mui-focused fieldset': { borderColor: 'blue.main' }
34-
}
3533
}}
34+
sx={
35+
{
36+
'& .MuiInputLabel-root.Mui-focused': {
37+
color: 'blue.main',
38+
},
39+
'& .MuiOutlinedInput-root': {
40+
'&:hover fieldset': { borderColor: 'blue.main' },
41+
'&.Mui-focused fieldset': { borderColor: 'blue.main' }
42+
}
43+
}}
3644
/>
3745
</FormControl>
3846
</LocalizationProvider>

0 commit comments

Comments
 (0)