Skip to content

Commit

Permalink
(#0) InputSelect value 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
baegofda committed Dec 4, 2023
1 parent 4391e11 commit f115648
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const Default = (props: InputSelectProps) => {
label = {props.label ?? "레이블"}
placeholder = {props.placeholder ?? "메뉴 선택"}
options = {options}
value = {currentValue}
onChange = {onChangeHandler}
/>
);
Expand Down
5 changes: 3 additions & 2 deletions src/core/components/Input/InputSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const InputSelect = forwardRef((
{
options,
placeholder,
value,
...props
}: InputSelectProps,
ref: React.Ref<HTMLSelectElement>,
Expand All @@ -17,7 +18,7 @@ const InputSelect = forwardRef((
const { label, rootClassName, className, onChange, required, ...rest } = props;

const onChangeHandler = (e: React.ChangeEvent<HTMLSelectElement>) => {
!isSelectedValue &&setIsSelectedValue(true);
!isSelectedValue && setIsSelectedValue(true);
onChange?.(e);
};

Expand All @@ -32,7 +33,7 @@ const InputSelect = forwardRef((
ref = {ref}
className = {clsx(
"text-subhead-02-regular outline-none cursor-pointer",
!isSelectedValue ? "text-gray-05" : "text-gray-08",
!value && !isSelectedValue ? "text-gray-05" : "text-gray-08",
className,
)}
onChange = {onChangeHandler}
Expand Down

0 comments on commit f115648

Please sign in to comment.