Skip to content

Commit

Permalink
chore: temp add console on select search
Browse files Browse the repository at this point in the history
  • Loading branch information
luizakp committed Apr 26, 2024
1 parent b713ae5 commit 922afb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const MultiSelectCheckboxes =
<FormDescription>{field.description}</FormDescription>
</div>
<div className="h-20 overflow-y-auto">
{field.options.map((item) => (
{field.options?.map((item) => (
<FormField
key={item.value}
control={form.control}
Expand Down
6 changes: 3 additions & 3 deletions src/components/FormBuilder/fields/selects/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface MultiSelectField extends SelectFieldProps {

export const MultiSelect = withConditional<MultiSelectField>(
({ form, field }) => {
const [options, setOptions] = React.useState(field.options);
const [options, setOptions] = React.useState(field.options || []);
const selection = form.watch(field.name) || [];

const addNewTag = ({ tag }) => {
Expand Down Expand Up @@ -91,7 +91,7 @@ export const MultiSelect = withConditional<MultiSelectField>(
</Badge>
<div className="hidden space-x-1 lg:flex">
{options
.filter((option) =>
?.filter((option) =>
formField.value?.includes(option.value)
)
.map((option) => (
Expand All @@ -113,7 +113,7 @@ export const MultiSelect = withConditional<MultiSelectField>(
<Command>
<CommandInput placeholder={field.placeholder} />
<CommandList>
{options.map((option) => {
{options?.map((option) => {
const isSelected = formFieldValue.includes(
option.value
);
Expand Down

0 comments on commit 922afb7

Please sign in to comment.