Ignore extraneous spaces when filtering the folder list
Filter strings with e.g. a trailing space were split into the search term and the empty string. But the empty string can be found in every folder name, so all folders were displayed. This change drops all search terms that are the empty string.
This commit is contained in:
parent
3a6ca8dfd5
commit
c43cb3868b
1 changed files with 1 additions and 0 deletions
|
@ -146,6 +146,7 @@ class ManageFoldersFragment : Fragment() {
|
|||
val locale = Locale.getDefault()
|
||||
val displayName = item.displayName.toLowerCase(locale)
|
||||
return constraint.splitToSequence(" ")
|
||||
.filter { it.isNotEmpty() }
|
||||
.map { it.toLowerCase(locale) }
|
||||
.any { it in displayName }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue