Skip to content

Commit

Permalink
Fix TextFieldWidget2 not focusing the gui (GregTechCEu#2064)
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 authored and ghzdude committed Oct 25, 2023
1 parent fe3c45f commit f0bac7a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/gregtech/api/gui/widgets/TextFieldWidget2.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ private void drawSelectionBox(float x, float y, float width) {
public boolean mouseClicked(int mouseX, int mouseY, int button) {
if (isMouseOverElement(mouseX, mouseY)) {
focused = true;
gui.getModularUIGui().setFocused(true);
if (onFocus != null) {
onFocus.accept(this);
}
Expand Down Expand Up @@ -438,6 +439,7 @@ public void unFocus() {
setText(t);
setter.accept(t);
focused = false;
gui.getModularUIGui().setFocused(false);
writeClientAction(-1, buf -> buf.writeString(t));
}

Expand Down

0 comments on commit f0bac7a

Please sign in to comment.