Regain focus after re-enabling UIDocument

I am disabling the UIDocument script to deactivate the UIDocument (it’s a pause menu), but upon re-enabling the UI document, I can’t use the keyboard to navigate the UIDocument until I click a particular button. How can I regain focus automatically?

e.Focus();