details-dialog-element
details-dialog-element copied to clipboard
Trap focus when connected in `<details open>`
When the <details-dialog>
element is connected to the document as a
child of a <details>
element rendered with [open]
, trap focus
immediately.
In support of this change, extract the trapFocus
and releaseFocus
functions, then call trapFocus
within the connectedCallback
if the
ancestor detail is [open]
.