Page 1 of 1

[2.0.21] Display panel "Edit message" does not focus text box automatically

Posted: Fri Nov 29, 2024 9:09 pm
by jyasutin
Some (most?) dialog boxes that exist exclusively for text input automatically focus the text box when opened.

What I did:

1. Place a constant combinator.
2. Left click on the constant combinator and then click the "Add description" button.

What happens:

* The resulting "Edit description" dialog automatically focuses the text box, as expected.

However a display panel's label dialog does not focus the text box.

What I did next:

1. Place a display panel next to the constant combinator and connect the two with a red circuit.
2. Left click on the display panel; due to the circuit connection you should see one message entry with "(No label)".
3. Click the pencil icon next to "(No label)".

What I expect:

* The dialog that opens should automatically focus the text box.

What happens:

* The resulting "Edit Message" dialog does NOT focus the text box automatically and if I start typing, I am likely to trigger other actions.

(Pedantic nitpick: "Edit Message" dialog title is proper-case but most other dialog titles are not.)

This may seem minor but a number of times now I've started typing text intended for a label on a display panel only to trigger actions in the world (which among other things may immediately close the Display panel dialog). Ironically the display panel is one of the few dialogs that confirms if you want to discard changes when you hit Esc, but I keep bypassing that check by typing, for example, "Left" (Shift-L immediately brings up logistic networks and closes the display panel dialog).

Re: [2.0.21] Display panel "Edit message" does not focus text box automatically

Posted: Fri Nov 29, 2024 11:59 pm
by LCStark
Yeah, I agree. I mentioned the focus issue while reporting the discard changes bypass in this topic: 119518. Those two issues may be minor, but they are impacting QoL of the display panel quite significantly.

Re: [2.0.21] Display panel "Edit message" does not focus text box automatically

Posted: Sat Nov 30, 2024 12:06 am
by jyasutin
Thanks for the link, I searched for "focus" and your post didn't turn up. I agree both issues should be corrected -- if a dialog has a "discard changes" confirmation then it shouldn't be so trivial to completely bypass it.