Skip to content

Commit

Permalink
Fix/input classname required (#133)
Browse files Browse the repository at this point in the history
## 바뀐점

## 바꾼이유

## 설명
  • Loading branch information
Skyrich2000 authored Jul 17, 2023
2 parents bf8648c + fa3e8f1 commit 179b599
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cx from 'classnames';
import type { InputHTMLAttributes, ReactNode } from 'react';
import { forwardRef, useId } from 'react';
import { Text } from '../Text';
import { useControllableState } from '../../utils/useControllableState';
import { Text } from '../Text';

interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
/**
Expand Down Expand Up @@ -89,6 +89,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
hasError,
maxLength,
disabled,
className,
onValueChange: onValueChangeFromProps,
...restProps
},
Expand All @@ -110,9 +111,13 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(

return (
<div
className={cx('flex flex-col space-y-2', {
'opacity-40': disabled,
})}
className={cx(
'flex flex-col space-y-2',
{
'opacity-40': disabled,
},
className,
)}
>
<div className="flex w-full">
{label && (
Expand Down Expand Up @@ -161,6 +166,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
onChange={handleChange}
maxLength={maxLength}
disabled={disabled}
required={required}
{...restProps}
/>
{rightAddon && <span className="flex">{rightAddon}</span>}
Expand Down

0 comments on commit 179b599

Please sign in to comment.