You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment (please complete the following information)
Operating System: windows
Browser, Version Chrome 133
react-overlays Version ?
Additional context
document.activeElement returns the custom element since it is the deepest element in the light DOM that has focus. However restoring focus to the custom element in the light DOM isn't enough. There could be multiple elements in the shadow DOM of the custom element. And at this point the shadowRoot.activeElement has lost the reference to the originally focused elements.
the activeElement would need to capture the deepest element piercing the shadow roots when saving the originally focused element.
The text was updated successfully, but these errors were encountered:
Describe the bug
Modal
does not return focus to the previous element on closing when hosted inside of a custom element shadow root.To Reproduce
Steps to reproduce the behavior:
Reproducible Example
Minimal example by using CodeSandbox.
Expected behavior
The original button should have focus.
Screenshots
modal-focus-bug-edit.mp4
Environment (please complete the following information)
Additional context
document.activeElement
returns the custom element since it is the deepest element in the light DOM that has focus. However restoring focus to the custom element in the light DOM isn't enough. There could be multiple elements in the shadow DOM of the custom element. And at this point theshadowRoot.activeElement
has lost the reference to the originally focused elements.the
activeElement
would need to capture the deepest element piercing the shadow roots when saving the originally focused element.The text was updated successfully, but these errors were encountered: