Deloser: support rendered but not visible modals
bsunderhus opened this issue · comments
Bernardo Sunderhus commented
Current behavior
At the moment, deloser attributes assume a modal is opened when it's added to the DOM and is closed when it's removed from the DOM, returning the focus to the previous deloser once the modal is closed.
This is not ideal for native modals such as <dialog>
since the element is always present at the DOM and it's visibility is dictated by display: none
Requested change
Allow deloser to identify the element is not focusable anymore in the DOM although it's still present, therefore allowing return of the focus to the previous deloser.