Skip to content

Commit

Permalink
fix: don't switch between controlled/uncontrolled inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Sep 22, 2023
1 parent e32c4ff commit b20e298
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/components/InputOrGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const InputOrGroup = ({
className={getClassName("input")}
autoComplete="off"
name={name}
value={value}
value={typeof value === "undefined" ? "" : value}
onChange={(e) => onChange(e.currentTarget.value)}
readOnly={readOnly}
rows={5}
Expand Down Expand Up @@ -291,7 +291,7 @@ export const InputOrGroup = ({
autoComplete="off"
type={field.type}
name={name}
value={value}
value={typeof value === "undefined" ? "" : value}
onChange={(e) => {
if (field.type === "number") {
onChange(Number(e.currentTarget.value));
Expand Down

0 comments on commit b20e298

Please sign in to comment.