Skip to content

Commit

Permalink
Fix SelectSearch option filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksamies committed Nov 27, 2023
1 parent 50937e6 commit a7df0b5
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions packages/cyberstorm/src/components/SelectSearch/SelectSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,22 @@ export const SelectSearch = React.forwardRef<HTMLInputElement, Props>(
isVisible ? styles.visible : null
)}
>
{options.map((option) => {
return (
<SelectItem
key={option}
onClick={(e) => {
onChange(option);
e.stopPropagation();
}}
option={option}
/>
);
})}
{options
.filter((option) =>
option.toLowerCase().includes(search.toLowerCase())
)
.map((option) => {
return (
<SelectItem
key={option}
onClick={(e) => {
onChange(option);
e.stopPropagation();
}}
option={option}
/>
);
})}
</div>
</div>
</div>
Expand Down

0 comments on commit a7df0b5

Please sign in to comment.