Dialog: Restore focus to the previously focused element when window regains focus. Fixes #9101 - Dialog: Track last focused element instead of always focusing the first tabbable element
Dialog: Fix coding style issues
Update test to reuse element reference
No need to reset this._focusedElement on open