Skip to content

Commit

Permalink
Fix get options utility
Browse files Browse the repository at this point in the history
  • Loading branch information
mimshins committed May 26, 2024
1 parent ab30cf5 commit 29a28cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Select/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ export const noValueSelected = (value: string | string[] | undefined) =>

export const getOptions = (
childArray: Array<Exclude<React.ReactNode, boolean | null | undefined>>,
isInList = false,
) => {
let isListFound = false;
let isListFound = isInList;

const recurse = (
childArray: Array<Exclude<React.ReactNode, boolean | null | undefined>>,
isInList = false,
isInList: boolean,
): Array<
PickAsMandatory<OptionProps, "disabled" | "value" | "valueLabel">
> => {
Expand Down Expand Up @@ -92,7 +93,7 @@ export const getOptions = (
);
};

return recurse(childArray);
return recurse(childArray, isInList);
};

type Registry<Key extends string> = Map<Key, string>;
Expand Down

0 comments on commit 29a28cb

Please sign in to comment.