diff --git a/widget/src/combo_box.rs b/widget/src/combo_box.rs index 785185c7..a5bf361d 100644 --- a/widget/src/combo_box.rs +++ b/widget/src/combo_box.rs @@ -977,7 +977,8 @@ where { let query: Vec = query .to_lowercase() - .split(|c: char| !c.is_ascii_alphanumeric()) + .split(char::is_whitespace) + .filter(|s| !s.is_empty()) .map(String::from) .collect(); @@ -1007,7 +1008,5 @@ fn build_matcher(option: T) -> String where T: Display, { - let mut matcher = option.to_string(); - matcher.retain(|c| c.is_ascii_alphanumeric()); - matcher.to_lowercase() + option.to_string().to_lowercase() }