Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes date fields autofilling on edit #73

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ interface DateFieldProps {
export function DateField(props: DateFieldProps): JSX.Element {
const classes = useStyles();

const dateValue = props.value || 'yyyy/MM/dd';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'yyyy/MM/dd' seems to be a format not a value, am I missing something?


return (
<div className={classes.fieldRow}>
<LocalizationProvider dateAdapter={AdapterDateFns}>
Expand All @@ -204,7 +206,7 @@ export function DateField(props: DateFieldProps): JSX.Element {
mask="____/__/__"
minDate={new Date('2019/12/01')}
disableFuture
value={props.value}
value={dateValue}
onChange={props.onChange}
renderInput={(params) => (
<MuiTextField
Expand Down
Loading