fix: prevent calling focus on elements within template elements (#9712)
* fix: prevent calling focus on elements within template elements
* make check in focusSafely more robust and repalce dialog with div
we can use a div instead because popovers render as dialogs anyways and this sidesteps the autofocus behavior of useDialog