Skip to content

Commit dd1df32

Browse files
committed
Update filtering function
1 parent 9fc2837 commit dd1df32

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Components/forms/inputs/AutoFillDropDown.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ const AutoFillDropDown = ({
1313
const filteredEmployers = arrayList.filter(item => {
1414
const searchTerm = value.toLowerCase()
1515
const employer = item.name.toLowerCase()
16-
const matchSearch =
17-
value.length === 1
18-
? employer.includes(searchTerm)
19-
: employer.startsWith(searchTerm)
20-
return searchTerm && matchSearch && employer !== searchTerm
16+
const matchSearch = employer.includes(searchTerm)
17+
return searchTerm && matchSearch
2118
})
2219
const employerSorter = (a, b) => {
2320
const aIndex = a.name.toLowerCase().indexOf(value.toLowerCase())

0 commit comments

Comments
 (0)