Skip to content

Commit 95edab4

Browse files
joshsj89onmotion
andauthored
Update src/index.tsx
Co-authored-by: Alexandr Kozhevnikov <[email protected]>
1 parent 4fcb4ee commit 95edab4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/index.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,9 @@ export const AutocompleteDropdown = memo<
306306

307307
const newSet = initialDataSet.filter((item: AutocompleteDropdownItem) => {
308308
const titleLowercase = (item.title || '').toLowerCase()
309-
let findWhere: string
310-
311-
if (caseSensitive) {
312-
findWhere = ignoreAccents ? diacriticless(item.title || '') : item.title || ''
313-
} else {
314-
findWhere = ignoreAccents ? diacriticless(titleLowercase) : titleLowercase
315-
}
309+
const titleStr = item.title || ''
310+
const title = caseSensitive ? titleStr : titleStr.toLowerCase()
311+
const findWhere = ignoreAccents ? diacriticless(title) : title
316312

317313
if (matchFromStart) {
318314
return typeof item.title === 'string' && findWhere.startsWith(findWhat)

0 commit comments

Comments
 (0)