Skip to content

Commit

Permalink
(#0) Update InputDatePicker Disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cause38 committed Jan 29, 2024
1 parent dfb402c commit 7a884d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/components/Input/InputDatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const InputDatePicker = ({
};

const handleDatePicker = async () => {
if (disabled) return;
const periodDates = await onDatePickerClick();
setPeriodDates(periodDates);
};
Expand All @@ -78,15 +79,19 @@ const InputDatePicker = ({
return (
<InputBase
inputId = {id}
inputRootClassName = {clsx("h-[3.75rem] cursor-pointer relative", className)}
inputRootClassName = {clsx("h-[3.75rem] cursor-pointer relative", {
"cursor-not-allowed": disabled,
}, className)}
onClick = {handleDatePicker}
label = {label}
required = {required}
inputComponent = {
<input
type = "text"
placeholder = "날짜를 입력해주세요"
className = {clsx("flex-1 focus-visible:outline-0 cursor-pointer pointer-events-none", inputClassName)}
className = {clsx("flex-1 focus-visible:outline-0 cursor-pointer pointer-events-none", {
"cursor-not-allowed": disabled,
}, inputClassName)}
value = {periodDates.startDate && (!afterAllDate ? `${startDate}${periodDates.endDate && ` - ${endDate}`}` : `${startDate} ~`)}
onKeyDown = {() => false}
onFocus = {(e: React.FocusEvent<HTMLInputElement>) => e.target.blur()}
Expand Down

0 comments on commit 7a884d4

Please sign in to comment.