mojira.dev
MC-151412

"Edit Server Info" window does not focus "Server Name" text field automatically

The bug

When adding a new server entry ("Add Server" button) or editing an existing one ("Edit" button), the "Server Name" text field does not immediately have focus, though the cursor is blinking in it and pressing TAB ↹ switches to the "Server Address" field.

How to reproduce

  1. Open the "Multiplayer" server list

  2. Click "Add Server"

  3. Try to type a server name
    ❌ The cursor is blinking in the "Server Name" text field, but you cannot type in it

Code analysis

Code analysis by @unknown in this comment.

Linked issues

Attachments

Comments 14

Hmm, upon clicking on the text field, you can properly edit it. However, even before that the cursor is blinking, indicating that you should be able to write (which you can't).

still an issue in 19w40a

@unknown, please don't comment if you don't have anything to add to the ticket.

4 more comments

Can confirm in 21w14a.

Code analysis based on Minecraft 1.17 with yarn mappings.

In net.minecraft.client.gui.screen.AddServerScreen#init(), the game makes the server name field focused:

this.serverNameField.setTextFieldFocused(true);

This is the wrong, since it only makes it appear focused. Instead, it should use the following at the end of init():

this.setInitialFocus(this.serverNameField);

Can confirm in 1.18.1.

Can confirm in 1.18.2.

Can confirm in 1.19.

20Attila03

Panda4994

Confirmed

Normal

Accessibility, UI

Minecraft 1.14, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4, ..., 1.17.1 Release Candidate 1, 1.17.1, 1.18.1, 1.18.2, 1.19

22w46a

Retrieved