The bug
Triggers
toggling fullscreen
resizing the window
alt-tabbing out of the game in fullscreen (as of 17w43+)
Results
Changing text in most text boxes then will revert the text. Exceptions are naming (not renaming) a world, entering a seed and writing on a sign.
also resets the scroll bars in the statistics menu and returns you to the "General" tab.
disables most of a command block interface (as of 17w43+)
How to reproduce
Press 't' to bring up the console
Type something but don't send it
Toggle fullscreen or resize the window
The text disappears, or reverts to nothing when it should remain
Code analysis
from @unknown:
The reason for this is that the private void resize(int width, int height)
method of the net.minecraft.client.Minecraft
class (MCP names for Minecraft 1.8) calls the public void onResize(Minecraft mcIn, int width, int height)
method of the net.minecraft.client.gui.GuiScreen
class. This method however is a method that creates (not updates) the GUI. A partial fix would be to have the private void resize(int width, int height)
method call some kind of updating method only and passing the width and height. Additionally textboxes could have an anonymous class that calculates the position based on the attributes of the screen it is in.
Related issues
is duplicated by
relates to
Comments


It has always been present as far as I know

This also Happens with Text Boxes in the Main Menu, the "Preset" Textbox for superflat Worlds for example

Maybe related to grayed out buttons

Seems fixed in 1.4.7

It is partially fixed, I think. For instance, the seed text file doesn't reset when toggling, but the chat field does.

Still happens with the chat in 1.5

Also happens in the “Edit Server Info” screen (or at least when adding a new server).

Still happens in 13w26a.

still happens in 1.6.1. At least with the chat box.

yes, still happens in 1.6.2

Affects snapshot 13w36a.

still in 1.7.2

Affects snapshot 13w47c.

This is still an issue in Minecraft version 14w03b.

Still in 14w06b. Looks like its a pretty hard bug to be fixed.

Came across this issue in 14w07a today.

Still an issue in 14w10c

I think I found a different manifestation of this bug in the Command Block GUI. The difference was that I already saved a command inside (which would have remained if I didn't save my changes), and I pressed F11 and the old text was there.
I wasn't ADDING text, note, I was using the backspace key when I slipped and went into fullscreen. I'm also using 14w21b.

Confirmed in 1.8.

Also affects 1.8.1-pre1.

Still in 1.8.1-pre2 (just deleted a nether superflat code I was working on 😞).

Confirmed for 1.8.1.

Confirmed for 1.8.2-pre5.

Confirmed for 1.8.2-pre6

Confirmed for 1.8.4

Confirmed for 1.8.5, 1.8.6, and 1.8.7

Something similar to this also happens in the statistics menu, being scrolled down on the first page or being on another page and resizing puts you back to the first page again.

Can confirm for all 1.9 snapshots.

Affects 15w45a.

Affects 15w46a.

Confirmed in 15w47c for Command blocks, Chat, Anvil and Inventory search bar.

Affects 15w49a, tested with chat and Creative inventory.

Affects 15w50a.

Affects 15w51b.

Affects 16w02a.

Affects 16w03a.

Affects 16w04a.

Never seen, probably because I play mostly 1.8.9

Confirmed for
16w05b
The reason for this is that the private void resize(int width, int height)
method of the net.minecraft.client.Minecraft
class (MCP names for Minecraft 1.8) calls the public void func_175273_b(Minecraft mcIn, int p_175273_2_, int p_175273_3_)
method of the net.minecraft.client.gui.GuiScreen
class. This method however is a method that creates (not updates) the GUI. A partial fix would be to have the private void resize(int width, int height)
method call some kind of updating method only and passing the width and height. Additionally textboxes could have an anonymous class that calculates the position based on the attributes of the screen it is in.
Could you please link to this comment in the description

Affects 16w06a.

Affects 16w07a.

Affects 16w07b.

Confirmed for 1.9-pre1

Affects 1.9-pre3.

Affects 1.9-pre4.

Affects 1.9.1-pre3.

Affects 1.9.2.

Affects 16w20a and OS X 10.11.5.

Confirmed for Pre 1.10

Confirmed for Pre2 1.10

Confirmed for 1.10

Confirmed for 1.10.1.

Confirmed 1.10.2
1.10.2 is already listed.

Can confirm for all 1.11 snapshots

Confirmed for 1.11.2

i hate this bug, maybe i'm writing a long command in a small window because im seeing the wiki to see how do i write te command, and when i want to fullscreen the game to continue writing the entire commands dissapear

Confirmed for all 1.12 snapshots and 1.12-pre1, 1.12-pre2 and 1.12-pre3
As MC-121470 was marked as duplicating this, I'd like to add the following information:
This bug now also resets the scroll bars in the statistics menu and returns you to the "General" tab.
This bug now occurs when the user alt-tabs out of the game in fullscreen.
This bug now also disables most of a command block interface.

Is this still caused by what's in the code analysis?
It will also, for example, enable the "create world" button when it's supposed to be disabled (if there's no provided world name).

Confirmed for 17w50a.

confirmed in 18w03b for command block gui.

Confirmed for 18w05a

Confirmed for 18w07b

Confirmed for 18w20c

This is fixed for all text fields, but not scroll bars (pre2)
(let me know if i missed any)

@rherlitz
The text in the "Select a Preset" screen (Create New World > More World Options... > World Type: Superflat > Customize > Presets) reverts when the window changes size in pre2. It may be a separate issue though because it's perfectly fine for alt-tab out of and back into the window.
Also the recipe book search field goes blank on resize (but not alt-tab) for all three variants (inventory, crafting table, and furnace).

@unknown Thanks. I've fixed these too and they should work in the next update!

Awesome! Oh and I just though to check the structure block; the name field for all four versions of the GUI is also affected. Not sure about the controls, don't really know how the structure block works. ¯_(ツ)_/¯
Edit: Ok I was figuring out how the structure block works. Changing window size resets all modified text fields. It also appears to disable the text fields. Buttons keep their settings even when changed.

Thank you! I've fixed those as well now 🙂
also resets the scroll bars in the statistics menu and returns you to the "General" tab.
That still appears to be the case, I've created a new bug report about that here: MC-213104
This does indeed happen as described. Not sure if it was present in previous versions, but it does exist in 1.4.2-PRE