The bug
When trying to exit the Anvil GUI, if there is an item in the input slot and the textfield has focus, the inventory key cannot close the GUI. However after taking the item out and then trying to exit using the inventory key it exits correctly.
How to reproduce:
Right-click an anvil
Place an item on the left, like e.g. Stone
Click on the textfield or press TAB to give it focus(this step was introduced in 20w10a, because the textfield doesn't start focused anymore but was fixed later)Use the inventory key to close the GUI
> ❌ Nothing happensNow take out the item and try the inventory key again
> ✔ GUI now closes
Related issues
relates to
Attachments
Comments


Follow-up of MC-147184

Because the anvil doesn't focus the textfield anymore, I just discovered in 20w10a that the focus is required for this bug to happen. If the textfield has no focus, pressing the inventory key correctly closes the GUI.