Skip to content

Commit

Permalink
Merge pull request #70 from Eureka-Shoulders/fix/date-picker
Browse files Browse the repository at this point in the history
fix: using textFieldProps on datepicker
  • Loading branch information
Sampaio Leal authored May 3, 2022
2 parents 27ee8c6 + 4a3b2e9 commit d68e47a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/Inputs/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ export type DatePickerProps = {
value: Date | string | undefined;
} & Omit<MuiDatePickerProps, 'renderInput' | 'onChange' | 'value'>;

function DatePicker({ label, onChange, value, ...props }: DatePickerProps) {
function DatePicker({
label,
onChange,
value,
textFieldProps,
...props
}: DatePickerProps) {
return (
<MuiDatePicker
{...props}
value={value}
onChange={onChange}
label={label}
renderInput={(params) => <TextField {...params} fullWidth />}
renderInput={(params) => (
<TextField {...params} fullWidth {...textFieldProps} />
)}
/>
);
}
Expand Down

0 comments on commit d68e47a

Please sign in to comment.