Blocking player movements only works temporarily

Third person controller, v2.3.2

I use this code to stop the movement of my player:
EventHandler.ExecuteEvent(player, "OnEnableGameplayInput", false);
I implement it in an update, through input.

It works, but if I press the keys or click the screen several times or if I move the cursor, it ends up moving at the end, and it seems that under pressure it does not work, implement this considering a validation, so that the player cannot move when viewing an interface or reading a note.
 
OnEnableGameplayInput is called in the demo scene when you press escape to show the menu. I tried to reproduce this within the demo scene but wasn't able to. If you can list the steps to reproduce from a fresh project that would be great.
 
Top