diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/NameAutocompleter.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/NameAutocompleter.java index f5a4cba504..6dcaaecf83 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/NameAutocompleter.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/NameAutocompleter.java @@ -113,22 +113,20 @@ class NameAutocompleter implements KeyListener { if (isExpectedNext(input, charToInsert)) { - final int insertIndex = input.getSelectionStart(); - SwingUtilities.invokeLater(() -> + try { - try - { - // Insert the character and move the selection. - Document doc = input.getDocument(); - doc.remove(insertIndex, 1); - doc.insertString(insertIndex, charToInsert, null); - input.select(insertIndex + 1, input.getSelectionEnd()); - } - catch (BadLocationException ex) - { - log.warn("Could not insert character.", ex); - } - }); + // Insert the character and move the selection. + final int insertIndex = input.getSelectionStart(); + Document doc = input.getDocument(); + doc.remove(insertIndex, 1); + doc.insertString(insertIndex, charToInsert, null); + input.select(insertIndex + 1, input.getSelectionEnd()); + } + catch (BadLocationException ex) + { + log.warn("Could not insert character.", ex); + } + // Prevent default behavior. e.consume(); }