diff options
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/itemeditor/GuiElementTextField.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/GuiElementTextField.java b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/GuiElementTextField.java index 95dbeccd..aa88cb77 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/GuiElementTextField.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/GuiElementTextField.java @@ -212,6 +212,7 @@ public class GuiElementTextField extends GuiElement { if (focus) { //allows for pasting formatted text that includes "§" if (GuiScreen.isKeyComboCtrlV(keyCode)) { + textField.setEnabled(false); //The cursor position gets set to the end when using setText int oldCursorPosition = textField.getCursorPosition(); @@ -222,6 +223,8 @@ public class GuiElementTextField extends GuiElement { //writeText removes unwanted chars from the String which includes "§" textField.setText(stringBuilder.toString()); textField.setCursorPosition(oldCursorPosition + clipboardContent.length()); + } else { + textField.setEnabled(true); } if ((options & MULTILINE) != 0) { //Carriage return |