mojira.dev
MC-260764

Right-clicking will focus text fields

Unlike the majority of widgets within the user interface, text fields can be focused by right-clicking. In addition, right-clicking a text field then a button (or vice versa) will cause both widgets to be focused. One place this issue occurs is the structure block screen, similarly to MC-147605.

Note that right-clicking a text field is different from left-clicking in that left-clicking moves the cursor in the text field. If right-clicking a text field is intentional, I would at least expect it to move the cursor or change the selection in some way.

Relatedly, while there are no such cases to my knowledge in vanilla Minecraft where this would be an issue, please call (Yarn mappings) Element#mouseClicked for all elements in a EntryListWidget rather than short-circuiting. This is the same fix as what was done to ParentElement in MC-147605.

Code analysis (Yarn mappings)

Currently, the TextFieldWidget#setTextFieldFocused method does not check whether button == 0 for calling the TextFieldWidget#setTextFieldFocused method, while it does for calling the TextFieldWidget#setCursor method. A suggested fix would be to move the button == 0 check to encapsulate both calls.

Linked issues

Comments 3

In the future, please also detail player impact when creating bug reports, thanks.

Would player impact be that the focus indicated is quite confusing especially when managing to select multiple fields? In general, I just think it's an inconsistency bug.

haykam

Fantastime

Confirmed

Platform

Low

UI

1.19.3, 1.19.4 Pre-release 3

1.19.4 Pre-release 4

Retrieved