Fix lost focus when modals open/close (#12437)
Fix lost focus when modals open/close (#12437)

* Fix lost focus after modal closes

Regression caused by the use of the wicg-inert polyfill

* Fix regression introduced by wicg-inert

* Catch errors to please CodeClimate

dunn/mastodon,im-in-space/mastodon,tri-star/mastodon,lindwurm/mastodon,yi0713/mastodon,ikuradon/mastodon,tri-star/mastodon,yukimochi/mastodon,tri-star/mastodon,rainyday/mastodon,h3zjp/mastodon,h3zjp/mastodon,tootsuite/mastodon,tootcafe/mastodon,im-in-space/mastodon,maa123/mastodon,ykzts/mastodon,gol-cha/mastodon,Nyoho/mastodon,kirakiratter/mastodon,lynlynlynx/mastodon,MitarashiDango/mastodon,cobodo/mastodon,danhunsaker/mastodon,lynlynlynx/mastodon,Ryanaka/mastodon,kazh98/social.arnip.org,imas/mastodon,gol-cha/mastodon,h3zjp/mastodon,lynlynlynx/mastodon,glitch-soc/mastodon,kirakiratter/mastodon,ikuradon/mastodon,danhunsaker/mastodon,rainyday/mastodon,masto-donte-com-br/mastodon,maa123/mastodon,masto-donte-com-br/mastodon,glitch-soc/mastodon,glitch-soc/mastodon,ykzts/mastodon,yukimochi/mastodon,Nyoho/mastodon,abcang/mastodon,musashino205/mastodon,yukimochi/mastodon,theoria24/mastodon,tootcafe/mastodon,kazh98/social.arnip.org,tootsuite/mastodon,lindwurm/mastodon,maa123/mastodon,dunn/mastodon,tootsuite/mastodon,theoria24/mastodon,koba-lab/mastodon,dunn/mastodon,glitch-soc/mastodon,primenumber/mastodon,cobodo/mastodon,imas/mastodon,h3zjp/mastodon,abcang/mastodon,tootcafe/mastodon,masto-donte-com-br/mastodon,primenumber/mastodon,koba-lab/mastodon,Nyoho/mastodon,MitarashiDango/mastodon,tootsuite/mastodon,im-in-space/mastodon,cobodo/mastodon,koba-lab/mastodon,primenumber/mastodon,pinfort/mastodon,kazh98/social.arnip.org,lindwurm/mastodon,tootcafe/mastodon,gol-cha/mastodon,musashino205/mastodon,musashino205/mastodon,im-in-space/mastodon,yi0713/mastodon,Kirishima21/mastodon,danhunsaker/mastodon,rainyday/mastodon,musashino205/mastodon,theoria24/mastodon,masto-donte-com-br/mastodon,Ryanaka/mastodon,abcang/mastodon,yi0713/mastodon,kirakiratter/mastodon,Ryanaka/mastodon,Kirishima21/mastodon,gol-cha/mastodon,cobodo/mastodon,pinfort/mastodon,danhunsaker/mastodon,dunn/mastodon,MitarashiDango/mastodon,abcang/mastodon,koba-lab/mastodon,yukimochi/mastodon,Kirishima21/mastodon,Nyoho/mastodon,maa123/mastodon,pinfort/mastodon,Kirishima21/mastodon,kazh98/social.arnip.org,ikuradon/mastodon,rainyday/mastodon,theoria24/mastodon,ykzts/mastodon,MitarashiDango/mastodon,Ryanaka/mastodon,imas/mastodon,ikuradon/mastodon,lindwurm/mastodon,imas/mastodon,pinfort/mastodon,primenumber/mastodon,ykzts/mastodon,yi0713/mastodon,lynlynlynx/mastodon,tri-star/mastodon,kirakiratter/mastodon