diff --git a/src/DatePicker/DatePicker.story.tsx b/src/DatePicker/DatePicker.story.tsx index 0efee970f..5263dcda6 100644 --- a/src/DatePicker/DatePicker.story.tsx +++ b/src/DatePicker/DatePicker.story.tsx @@ -47,6 +47,17 @@ WithCustomDateFormat.story = { name: "with custom date format", }; +export const WithDisabled = () => ( + +); + +WithDisabled.story = { + name: "with disabled", +}; + export const WithDifferentSizes = () => ( { highlightDates?: ReactDatePickerProps["highlightDates"]; disableFlipping?: boolean; selected?: Date | null; + disabled?: boolean; } const DEFAULT_DATE_FORMAT = "yyyy-MMM-dd"; @@ -56,6 +57,7 @@ const DatePicker = forwardRef( onBlur, onFocus, selected, + disabled, ...props }, datePickerRef @@ -128,6 +130,7 @@ const DatePicker = forwardRef( const customInput = ( ( {({ locale }) => ( , "size"> & const DatePickerInput = forwardRef( ( { + disabled, onChange, onClick, onBlur, @@ -37,6 +38,7 @@ const DatePickerInput = forwardRef( ) => { const { t } = useTranslation(); const { placeholder, ...inputFieldProps } = inputProps; + inputFieldProps.disabled = disabled; const handleChange = (event: React.ChangeEvent) => { onInputChange(event); @@ -62,6 +64,7 @@ const DatePickerInput = forwardRef( return (