Hello ,
I have tested this issue in the 4.8.1 version of the engine and I have updated the report. I have also found that the workaround (setting the input mode to game only) still works. The reason that this is the case is because when the input is set to UI only when the user clicks the screen while the mouse is showing. So when the mouse is hidden again the input mode is still on UI only. This is why setting the input mode to game only when the mouse is hidden alleviates the issue. I hope that this information helps.
Make it a great day