Skip to content

Commit 27dd8a2

Browse files
committed
fix: apply filter by keywords if it is necessary
1 parent 3d2ff20 commit 27dd8a2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/components/ui/extended/combobox/index.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,19 @@ export function Combobox({
207207
)
208208
}
209209

210-
if (
211-
innerInputSearchValue &&
212-
!option.label
210+
if (customItem && innerInputSearchValue.trim() !== '') {
211+
const _search = innerInputSearchValue
213212
.toLowerCase()
214-
.includes(innerInputSearchValue.toLowerCase())
215-
) {
216-
return null
213+
.trim()
214+
const _keys =
215+
option.keywords &&
216+
option.keywords.some((keyword) =>
217+
keyword.toLowerCase().trim().includes(_search)
218+
)
219+
220+
if (!_keys) {
221+
return null
222+
}
217223
}
218224

219225
return (

0 commit comments

Comments
 (0)