I have discovered that in the top row of my inventory often times the last 3 boxes on the right fail to work. It happens at random and I don't believe it is a problem specifically from my computer because it happens to my friends as well. When I hover over the boxes often times my normal mouse shows up or the game might highlight the box but not really register the item in it. I can't remove these items unless I manage to get the box highlighted, then I can press "Q" to throw the item out of my inventory and repick it up so its in a new slot. the only other solution to this issue that I have found is to restart my computer. Exiting and reentering the game does not work. This has yet to happen to me in a single player world but I believe that is only because I don't often play single player.
See MC-143776