The bug:
it is unable to close the inventory when binding the "Open/Close Inventory" key to a mouse button.
Steps to reproduce:
Bind the "Open/Close Inventory" key to a mouse button like Button5.
Use Button 5 in game to open the inventory.
Try to use Button 5 again to close the inventory.
Expected result:
The inventory will be closed.
Actual result:
The game will do nothing.
…maybe a duplicate of MC-156810. I forgot to search for it first. Sorry for that.