Skip to content

Commit

Permalink
⏪️(react) cancel options reset for select mono searchable
Browse files Browse the repository at this point in the history
This reverts commit a1515a2.
  • Loading branch information
daproclaima committed Jun 27, 2024
1 parent accd6ac commit c7fe0bc
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,12 @@ export const SelectMonoSearchable = forwardRef<SelectHandle, SubProps>(
return;
}

const arrayOptions = Array.isArray(props.options)
? props.options
: optionsToDisplay || undefined;

if (arrayOptions) {
if (Array.isArray(props.options)) {
const selectedItem = downshiftReturn.selectedItem
? optionToValue(downshiftReturn.selectedItem)
: undefined;

const optionToSelect = arrayOptions.find(
const optionToSelect = props.options.find(
(option) => optionToValue(option) === props.value,
);

Expand Down

0 comments on commit c7fe0bc

Please sign in to comment.