From 65b4f7ba8374bbaebc6a431f8347ffc3e8afdced Mon Sep 17 00:00:00 2001 From: Crendgrim Date: Tue, 11 Jun 2024 16:41:47 +0200 Subject: Fix dropdown controllers erroneously showing their dropdown (#183) Whenever a text input followed a dropdown controller, the dropdown controller would act on the key press and show its widget. --- .../gui/controllers/dropdown/AbstractDropdownControllerElement.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main') diff --git a/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java b/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java index 7e73332..cc56c11 100644 --- a/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java +++ b/src/main/java/dev/isxander/yacl3/gui/controllers/dropdown/AbstractDropdownControllerElement.java @@ -104,6 +104,9 @@ public abstract class AbstractDropdownControllerElement extends StringCont @Override public boolean charTyped(char chr, int modifiers) { + if (!inputFieldFocused) { + return false; + } if (!dropdownVisible) { createDropdownWidget(); } -- cgit