Skip to content

Commit f7c7fc9

Browse files
committed
fix: Fix filtered text boxes not properly inserting text on 26.1
1 parent 889e8e8 commit f7c7fc9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/mod/bluestaggo/modernerbeta/client/gui/widget/FilteredEditBox.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ public void insertText(final String input) {
7070
String updated = new StringBuilder(value).replace(start, end, text).toString();
7171
if (this.filter.test(updated)) {
7272
accessor.setValue(updated);
73-
this.setCursorPosition(start + insertionLength);
74-
this.setHighlightPos(cursorPos);
73+
int newCursorPos = start + insertionLength;
74+
this.setCursorPosition(newCursorPos);
75+
this.setHighlightPos(newCursorPos);
7576
accessor.invokeOnValueChange(updated);
7677
}
7778
}

0 commit comments

Comments
 (0)