allow searching multiple words when searching for process models w/ burnettk

This commit is contained in:
jasquat 2023-03-27 11:25:55 -04:00
parent 199cf05960
commit f0a12b9818
No known key found for this signature in database
1 changed files with 11 additions and 4 deletions

View File

@ -36,10 +36,17 @@ export default function ProcessModelSearch({
const shouldFilterProcessModel = (options: any) => {
const processModel: ProcessModel = options.item;
const { inputValue } = options;
return getFullProcessModelLabel(processModel)
.toLowerCase()
.includes((inputValue || '').toLowerCase());
let { inputValue } = options;
if (!inputValue) {
inputValue = '';
}
const inputValueArray = inputValue.split(' ');
const processModelLowerCase =
getFullProcessModelLabel(processModel).toLowerCase();
return inputValueArray.every((i: any) => {
return processModelLowerCase.includes((i || '').toLowerCase());
});
};
return (
<ComboBox