Skip to content

Commit

Permalink
feat: add disable direct input on SearchInput
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwoo00106 committed Sep 8, 2023
1 parent b1f9bc3 commit b1ba97a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const FilterModal = () => {
value={watch('techStacks')}
control={control}
register={register('techStacks')}
disableDirectInput
error=''
/>
</RangeSliderSection>
Expand Down
4 changes: 3 additions & 1 deletion packages/shared/src/molecules/SearchInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface Props {
limit?: number
control: Control<any>
register: UseFormRegisterReturn<any>
disableDirectInput?: boolean
}

const SearchInput = ({
Expand All @@ -28,6 +29,7 @@ const SearchInput = ({
onChange,
limit,
control,
disableDirectInput,
}: Props) => {
const { fields, append, remove } = useFieldArray<FieldValues>({
control,
Expand Down Expand Up @@ -102,7 +104,7 @@ const SearchInput = ({
{i}
</Dropdown.Item>
))}
{!includesValue() && (
{!includesValue() && !disableDirectInput && (
<Dropdown.Item onClick={() => onAddStack(searchValue)}>
{`+ "${searchValue}" 직접 추가하기`}
</Dropdown.Item>
Expand Down

0 comments on commit b1ba97a

Please sign in to comment.