For people that use the standalone password generator as part of their workflow, it would be better if they didn't have to refocus the previous input field after they close the generator panel.
document.activeElement.hasFocus() will tell us what is currently focussed
If it exists we can store a reference to the activeElement in the PanelStub instance
When closing the PanelStub we can call .focus() on the referenced element, assuming it still exists.
We have to do it only for the password generator panel (changing focus after filling the form could trigger unwanted side-effects)
For people that use the standalone password generator as part of their workflow, it would be better if they didn't have to refocus the previous input field after they close the generator panel.