Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions widget/src/combo_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -806,7 +807,7 @@ where
{
let query: Vec<String> = query
.to_lowercase()
.split(|c: char| !c.is_ascii_alphanumeric())
.unicode_words()
.map(String::from)
.collect();

Expand Down Expand Up @@ -834,7 +835,9 @@ fn build_matcher<T>(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::<String>()
.to_lowercase()
}
Loading