From 05f158fd51ae7961e16d4177ede38b95bb45f5b4 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 21 Apr 2023 21:29:39 -0400 Subject: [PATCH] Fixed #8523 --- core/src/mindustry/core/UI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index bbdd3eab77..1c650935c3 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -279,7 +279,8 @@ public class UI implements ApplicationListener, Loadable{ cont.margin(30).add(text).padRight(6f); TextFieldFilter filter = numbers ? TextFieldFilter.digitsOnly : (f, c) -> true; TextField field = cont.field(def, t -> {}).size(330f, 50f).get(); - field.setFilter((f, c) -> field.getText().length() < textLength && filter.acceptChar(f, c)); + field.setMaxLength(textLength); + field.setFilter(filter); buttons.defaults().size(120, 54).pad(4); buttons.button("@cancel", () -> { closed.run();