Skip to content

Commit

Permalink
chore: add disable property to input and select field
Browse files Browse the repository at this point in the history
  • Loading branch information
luizakp committed Mar 14, 2024
1 parent 2bd8f63 commit 5b87ed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/FormBuilder/fields/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const InputField = withConditional<InputFieldProps>(
<Input
placeholder={field.placeholder}
{...formField}
disabled={field.disabled ? (field.disabled as boolean) : false}
type={field.mode}
onWheel={(event) =>
field.mode === "number" &&
Expand Down
1 change: 1 addition & 0 deletions src/components/FormBuilder/fields/selects/SelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const SelectField = withConditional<SelectFieldProps>(
onValueChange={formField.onChange}
defaultValue={String(formField.value)}
name={field.name}
disabled={field.disabled ? (field.disabled as boolean) : false}
>
<FormControl>
<Select.SelectTrigger className="h-10 w-full rounded-md border dark:border-2 shadow-none">
Expand Down

0 comments on commit 5b87ed7

Please sign in to comment.