-
Notifications
You must be signed in to change notification settings - Fork 22.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document Document.activeElement and ShadowRoot.activeElement separate…
…ly. (#2395) * yarn content move Web/API/DocumentOrShadowRoot/activeElement Web/API/Document/activeElement * Update document.activeElement * Update document interface page * Update link to activeElement from css page * Update ShadowRoot interface page * Add new page for ShadowRoot.activeElement * fix case of dir * copy edit * copy edit Co-authored-by: Chris Mills <cmills@mozilla.com>
- Loading branch information
1 parent
8f6de46
commit 55812d1
Showing
7 changed files
with
97 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: ShadowRoot.activeElement | ||
slug: Web/API/ShadowRoot/activeElement | ||
tags: | ||
- API | ||
- Property | ||
- Reference | ||
- ShadowRoot | ||
- Web Components | ||
- shadow dom | ||
--- | ||
<div>{{APIRef("Shadow DOM")}}</div> | ||
|
||
<p>The <strong><code>activeElement</code></strong> read-only property of the | ||
{{domxref("ShadowRoot")}} interface returns the element within the shadow tree that has focus.</p> | ||
|
||
<h2 id="Syntax">Syntax</h2> | ||
|
||
<pre class="brush: js"><var>shadowRoot</var>.activeElement</pre> | ||
|
||
<h3 id="Value">Value</h3> | ||
|
||
<p>The {{domxref('Element')}} which currently has focus, or <code>null</code> if there is no focused element.</p> | ||
|
||
<h2 id="Examples">Examples</h2> | ||
|
||
<pre class="brush: js notranslate">let customElem = document.querySelector('my-shadow-dom-element'); | ||
let shadow = customElem.shadowRoot; | ||
let focusedElem = shadow.activeElement;</pre> | ||
|
||
<h2 id="Specifications">Specifications</h2> | ||
|
||
<table class="standard-table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Specification</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>{{SpecName('HTML WHATWG','#dom-documentorshadowroot-activeelement', 'activeElement')}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<h2 id="Browser_compatibility">Browser compatibility</h2> | ||
|
||
<p>{{Compat("api.ShadowRoot.activeElement")}}</p> | ||
|
||
<h2>See also</h2> | ||
|
||
<ul> | ||
<li>{{domxref("Document.activeElement")}}</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters