Input states reset after change Input Mode with Enhanced Input System.

In my case I open “PauseMenu” on Esc key and hold. In input action event “IA_PauseMenu” the “Started” is called and within it I set input mode from “Game Only” to “Game And UI”. Even if I’m still holding a key immediately after that surprisingly “Completed” is called. Still holding a key, after 0.5-1s “Started” is call again and PauseMenu starts flickering (showing and hiding very fast). Probably in new Enhanced Input System there’s (intended or not) the functionality to resets all input states after changing input mode. Similarly if I press Esc before lauching the game and hold the key, then launch the game - PauseMenu shows up on viewport because event “Started” is called. I tried add Modifiers to “IA_PauseMenu” input action as “Pressed” or “Down” but the same behaviour.
I will be grateful for any help.

Hello!

If you are using Enhanced input I would recommend to change the context once the UI is open. Also if you can setup de binding of the input once the button released you are going to have all the cases fixed.