Skip to content

Commit

Permalink
fix: removed form tag from Input component (#379)
Browse files Browse the repository at this point in the history
It was causing the form to be submitted on press of Enter button
  • Loading branch information
faizplus authored Mar 8, 2024
1 parent 28b61e3 commit 35d130f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
const rightSideComponent = rightSideChild ?? <BsX strokeWidth={0.6} />

return (
<form className={cn(formVariants({ variant }), formClassName)}>
<div className={cn(formVariants({ variant }), formClassName)}>
<div className={cn(leftSideVariants(), leftSideClassName)}>
{leftSideComponent}
</div>
Expand All @@ -121,7 +121,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<button type="button" onClick={onClear} className={rightSideVariants()}>
{rightSideComponent}
</button>
</form>
</div>
)
}
)
Expand Down

0 comments on commit 35d130f

Please sign in to comment.