Skip to content

Commit

Permalink
Clarify the Live References section (#1067)
Browse files Browse the repository at this point in the history
  • Loading branch information
behowell authored Aug 17, 2024
1 parent 86c24b9 commit 9b225b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proposals/reference-target-explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ this.shadowRoot_.referenceTargetMap.htmlFor = "real-input";

#### Live references

Reference targets are a "live reference": if the host internally changes its reference target mapping, any element that references the host will use the updated mapping.
Reference targets are a "live reference". Any of the following changes could result in an element reference being updated:
* The host changes its `referenceTarget` or `referenceTargetMap` to refer to a different ID.
* An element with an `id` that matches its host's referenceTarget is added to or removed from the host's shadow tree.
* The `id` attribute of an element inside the host's shadow tree is changed to or from the referenceTarget ID.
* The host is added or removed from the DOM.
* The host's `id` attribute is changed.

In the example above, if the `aria-activedescendant` mapping is changed, then the `aria-activedescendant` of `<input>` will be changed to refer to the newly-mapped element.

Expand Down

0 comments on commit 9b225b0

Please sign in to comment.