Camera still moving while in Inventory

Hard to explain. when I play on any server and I go to my inventory or go in saddlebag of horse or any mechanic where I have to interact with UI my camera still moves in the background and doesn’t lock to the UI so sometimes I punch people or mostly my horse and he punts me across the ground because it happens mostly when going into saddlebag.

I really don’t know what’s wrong or if it is a setting or even if I explained it correctly. I use REWASD because of physical limitation for using a keyboard. but even when shutting down rewasd and using just a keyboard to enter my inventory it still does it.

Any help or advice would be greatly appreciated