If you get into a world and hold down your inventory or f5 key then it will permanently switch which might cause seizures for some people
Linked issues
Attachments
Comments 4
I don't know about windows or linux, but on mac it would be because your key repeat is very fast, and probably on windows and linux too. This is not a bug because every time minecraft gets the signal that E or F5 have been pressed, it switches.
This might be an issue with java on mac, because when I tested this on windows, it worked as intended. Sorry for the confusion.
Duplicate of MC-118107
This is an intended feature, not a bug.