diff --git a/components/MultipleSelectList.tsx b/components/MultipleSelectList.tsx index a3bba1d8..9f0bc17e 100644 --- a/components/MultipleSelectList.tsx +++ b/components/MultipleSelectList.tsx @@ -133,11 +133,11 @@ const MultipleSelectList: React.FC = ({ { - let result = data.filter((item: L1Keys) => { - val.toLowerCase(); - let row = item.value.toLowerCase() - return row.search(val.toLowerCase()) > -1; + onChangeText={(val: String) => { + let result = data.filter((item: L1Keys) => { + let valLower = val.toLowerCase().trim(); + let row = item.value.toLowerCase().trim(); + return row.includes(valLower); }); setFilteredData(result) }} diff --git a/components/SelectList.tsx b/components/SelectList.tsx index 234a7e10..7d1e1142 100644 --- a/components/SelectList.tsx +++ b/components/SelectList.tsx @@ -138,13 +138,13 @@ const SelectList: React.FC = ({ { - let result = data.filter((item: L1Keys) => { - val.toLowerCase(); - let row = item.value.toLowerCase() - return row.search(val.toLowerCase()) > -1; + onChangeText={(val: String) => { + let result = data.filter((item: L1Keys) => { + let valLower = val.toLowerCase().trim(); + let row = item.value.toLowerCase().trim(); + return row.includes(valLower); }); - setFilteredData(result) + setFilteredData(result); }} style={[{padding:0,height:20,flex:1,fontFamily},inputStyles]} />