mojira.dev
MC-312773

Pressing the enter key in the edit world screen saves a blank world name, while the "Save" button is disabled

The Bug:

Pressing the enter key in the edit world screen saves a blank world name, while the "Save" button is disabled.

The "Save" button in the edit world screen is disabled while the world name is blank, but pressing Enter in the name field still saves it. The world then loses its name, and the world list shows its folder name instead.

Steps to Reproduce:

  1. Create a world called "Mojira".

  2. Select it in the world list and then click "Edit".

  3. Delete the whole name so that the field is empty and then press the enter key.

  4. Observe what the world is called in the world list.

Observed Behavior:

Pressing the enter key saves the blank name.

Expected Behavior:

Pressing the enter key would do nothing while the name is blank, like the "Save" button.

Comments 1

Can confirm in 26.4 Snapshot 5. EditWorldScreen#keyPressed calls onRename for the confirmation key without checking whether the name is blank, while the "Save" button's active state is set from !StringUtil.isBlank(newName) in the responder of the name box.

Avoma

(Unassigned)

Community Consensus

UI

26.3, 26.4 Snapshot 5

Retrieved