From 4b2388466aae42ab37f37b60b0ee33894b32bef8 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Thu, 27 May 2021 21:59:11 +0300 Subject: Fix #111 --- src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index ba47296..5f6059f 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -559,6 +559,7 @@ public class WTextField extends WWidget { String after = this.text.substring(cursor, this.text.length()); this.text = before+ch+after; cursor++; + if (onChanged != null) onChanged.accept(text); } } @@ -606,6 +607,8 @@ public class WTextField extends WWidget { if (cursor>text.length()) cursor = text.length(); } } + + if (onChanged != null) onChanged.accept(text); return; } else if (Screen.isSelectAll(ch)) { select = 0; @@ -639,6 +642,8 @@ public class WTextField extends WWidget { text = before+after; cursor--; } + + if (onChanged != null) onChanged.accept(text); } } else if (ch==GLFW.GLFW_KEY_LEFT) { if (select!=-1) { -- cgit