HTML Attributes
HTML shadowrootdelegatesfocus attribute
Enables focus delegation for a declaratively created shadow root, affecting how focus is forwarded to focusable shadow descendants. Applicable elements include: <template>. Check each element’s value rules. Boolean syntax: presence enables the state; omit the attribute to disable it. A string value of "false" does not turn it off.
Formal Syntax & Structure
html syntaxhtml
shadowrootdelegatesfocusParameters & Attributes
| Name | Type | Description |
|---|---|---|
| shadowrootdelegatesfocus | boolean | Enables focus delegation for a declaratively created shadow root, affecting how focus is forwarded to focusable shadow descendants. |
Working Example
Example Snippethtml
<div> <template shadowrootmode="open" shadowrootdelegatesfocus> <input aria-label="Search"> </template></div>