diff --git a/components/common/MySelect.tsx b/components/common/MySelect.tsx index f8085288a..0f4b8fe84 100644 --- a/components/common/MySelect.tsx +++ b/components/common/MySelect.tsx @@ -45,6 +45,14 @@ const DropdownIndicator = (props: any) => { ); }; +const customFilterOption = (option: any, rawInput: string) => { + const words = rawInput.split(" "); + return words.reduce( + (acc, cur) => acc && option.label.toLowerCase().includes(cur.toLowerCase()), + true + ); +}; + const MySelect: React.FC = ({ options, components, @@ -105,6 +113,7 @@ const MySelect: React.FC = ({ isDisabled={isDisabled} isClearable={isClearable} options={options} + filterOption={customFilterOption} components={ hideMenuBeforeTyping ? {