fix(picker): no longer `trim` search pattern (#11406)

pull/11083/head^2
RoloEdits 2 months ago committed by GitHub
parent d6431f41d9
commit f52251960a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -58,11 +58,16 @@ impl PickerQuery {
() => { () => {
let key = field.take().unwrap_or(primary_field); let key = field.take().unwrap_or(primary_field);
// Trims one space from the end, enabling leading and trailing
// spaces in search patterns, while also retaining spaces as separators
// between column filters.
let pat = text.strip_suffix(' ').unwrap_or(&text);
if let Some(pattern) = fields.get_mut(key) { if let Some(pattern) = fields.get_mut(key) {
pattern.push(' '); pattern.push(' ');
pattern.push_str(text.trim()); pattern.push_str(pat);
} else { } else {
fields.insert(key.clone(), text.trim().to_string()); fields.insert(key.clone(), pat.to_string());
} }
text.clear(); text.clear();
}; };

Loading…
Cancel
Save