diff --git a/widget/src/combo_box.rs b/widget/src/combo_box.rs index f038503c92..5a29cf46b1 100644 --- a/widget/src/combo_box.rs +++ b/widget/src/combo_box.rs @@ -73,6 +73,7 @@ use crate::text_input; use std::fmt::Display; use std::sync::atomic::{self, AtomicU64}; +use unicode_segmentation::UnicodeSegmentation; /// A widget for searching and selecting a single value from a list of options. /// @@ -806,7 +807,7 @@ where { let query: Vec = query .to_lowercase() - .split(|c: char| !c.is_ascii_alphanumeric()) + .unicode_words() .map(String::from) .collect(); @@ -834,7 +835,9 @@ 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() + .unicode_words() + .collect::() + .to_lowercase() }