Skip to content

Commit a30c8f8

Browse files
authored
fix(dropdown): make search on label value optional (#426)
* fix(dropdown): update check for item labels on search Check if label type is string before applying toLowerCase method on it (instead of value) * build(tests): Remove rule to run on master push * build(ci): add pull request trigger
1 parent db6bace commit a30c8f8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: tests
22

33
on:
4+
pull_request:
45
push:
56
branches:
67
- master

src/components/drops/menu/dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const Dropdown = ({
3434
if (!searchParams) return items
3535
const searchLowerCase = searchParams.toLowerCase()
3636
return items.filter(({ label, value }) => {
37-
if (typeof value === "string" && label.toLowerCase().includes(searchLowerCase)) return true
37+
if (typeof label === "string" && label.toLowerCase().includes(searchLowerCase)) return true
3838
if (typeof value === "string" && value.toLowerCase().includes(searchLowerCase)) return true
3939
return false
4040
})

0 commit comments

Comments
 (0)