mojira.dev
MC-147605

Text cursors can exist in multiple fields

The bug

When you simply click on input boxes in a certain order, the typing cursor shows for all the boxes. However, what you type will only go in the last box that you clicked.

Note: I get the impression that this happens when you first select a box "below" the next one.

How to reproduce

  1. Go to a place where there is more than one input box (for example in a structure block or in the "add multiplayer server" menu)

  2. Click on all the input boxes in several different orders

Examples

Here are some examples in videos:

[media]
[media]

Bug additions (Thanks Matolcsy Attila)

  • The bug is only visual, you can still only edit one box a time

  • Bug only appears when using mouse clicks, not while using Shift+Tab

  • Bug only appears if Server Adress is selected first, not the other way

Code Analysis provided by @unknown found in this comment

Linked issues

MC-147665 The blinking text cursor doesn't disappear when the textbox is deselected in a structure block Resolved MC-147759 Jigsaw Block Double Text Line Resolved MC-152185 Server ip and server name flashing at the same time Resolved MC-154696 Multiple blinking cursors in a gui screen with multiple textfields Resolved MC-155973 You can select multiple input boxes at the same time Resolved

Attachments

Comments 23

This also affects jigsaw and command blocks. I updated the ticket to include them.

This is still confirmed in the 1.14 Pre-release 5

Also affects the 'edit server info' screen... presumably every screen with more than one text field in it is affected.

Confirmed for 19w44a.

13 more comments

Can confirm in 1.19.

Can confirm in 1.19.2.

Code analysis using Yarn mappings:

The ParentElement#mouseClicked method iterates over children, returning early if a child handles a mouse click. Since text field widgets handle unfocusing within these clicks (TextFieldWidget#mouseClicked), if a prior child handles a mouse click successfully, then they will never get the chance to check for unfocusing. As a result, clicking a text field widget that's before another text field widget in the children list will not unfocus the latter text field widget.

A potential solution is to separate unfocusing clicking logic in a way that prevents it from being short-circuited.

This issue still exists on snapshot 22w42a.

This issue still exists on snapshot 22w43a.

Ray

Panda4994

Confirmed

Low

UI

GUI, command_block, cursor, field, input-box, jigsaw, multiple-input-boxes, structure_block, text, text-cursor

Minecraft 19w14b, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, , 1.19, 1.19.2, 22w42a, 22w43a, 22w45a

22w46a

Retrieved