fix: Make Starting Operator searching dropdown case insensitive for en (#15879)

This commit is contained in:
Zenith
2026-03-01 04:53:59 -08:00
committed by GitHub
parent 956199f815
commit 1cfb3cccda

View File

@@ -79,7 +79,7 @@ public static class ComboBoxExtensions
_logger.Debug("Searching for: {SearchTerm}", searchTerm);
// 如果文字完全匹配某个选项,恢复完整列表
object exactMatchItem = targetComboBox.ItemsSource.Cast<object>().FirstOrDefault(obj => obj?.ToString() == searchTerm);
object exactMatchItem = targetComboBox.ItemsSource.Cast<object>().FirstOrDefault(obj => string.Equals(obj?.ToString(), searchTerm, StringComparison.CurrentCultureIgnoreCase));
if (exactMatchItem != null)
{
@@ -96,7 +96,7 @@ public static class ComboBoxExtensions
}
else
{
targetComboBox.Items.Filter = item => item?.ToString()?.Contains(searchTerm) ?? false;
targetComboBox.Items.Filter = item => item?.ToString()?.Contains(searchTerm, StringComparison.CurrentCultureIgnoreCase) ?? false;
}
};