fix: check for pane focus before removing it. (#17164)
fix: check for pane focus before removing it. (#17164)

Fixes #16883. This bug seems to have been introduced in the #15302's
menu a11y refactor and is new in 5-0-x.
gerhardberger/electron,electron/electron,the-ress/electron,the-ress/electron,the-ress/electron,bpasero/electron,electron/electron,the-ress/electron,gerhardberger/electron,electron/electron,electron/electron,bpasero/electron,the-ress/electron,seanchas116/electron,seanchas116/electron,electron/electron,bpasero/electron,gerhardberger/electron,bpasero/electron,the-ress/electron,bpasero/electron,seanchas116/electron,bpasero/electron,electron/electron,seanchas116/electron,seanchas116/electron,gerhardberger/electron,seanchas116/electron,gerhardberger/electron,gerhardberger/electron,bpasero/electron,electron/electron,the-ress/electron,gerhardberger/electron