The right click is probably tied to camera logic. Either in the player controller or character.
Have a bool that toggles if you are in the inventory and override that camera logic (through a branch)
either
- enforce the cursor visibility there
- make the engine ignore the camera input.
You can also have a full screen canvas in inentory that triggers iu only (its a 100% transparent)