From 2f6d1a7e3c2e51254908a603205fd9cefad3e97c Mon Sep 17 00:00:00 2001 From: Matti Ruohonen Date: Sun, 3 Jul 2022 01:48:46 +0300 Subject: [PATCH] DropDownListWidget: Fix the search string not being case-insensitive --- .../fi/dy/masa/malilib/gui/widget/DropDownListWidget.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/fi/dy/masa/malilib/gui/widget/DropDownListWidget.java b/src/main/java/fi/dy/masa/malilib/gui/widget/DropDownListWidget.java index 276f9acd7d..acc449e3a9 100644 --- a/src/main/java/fi/dy/masa/malilib/gui/widget/DropDownListWidget.java +++ b/src/main/java/fi/dy/masa/malilib/gui/widget/DropDownListWidget.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.function.Function; import java.util.function.IntSupplier; import java.util.function.Supplier; @@ -556,7 +557,8 @@ protected void updateFilteredEntries(String searchText) protected boolean entryMatchesFilter(T entry, String filterText) { - return filterText.isEmpty() || this.getDisplayString(entry).toLowerCase().contains(filterText); + return filterText.isEmpty() || + this.getDisplayString(entry).toLowerCase(Locale.ROOT).contains(filterText.toLowerCase(Locale.ROOT)); } protected int getRequiredWidth(List entriesIn,