Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created June 16, 2022 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/2346b6681c3543e91cc827ba36aad386 to your computer and use it in GitHub Desktop.
Save nolanlawson/2346b6681c3543e91cc827ba36aad386 to your computer and use it in GitHub Desktop.
delegation
<!-- delegation -->
<x-input aria-labelledby="foo">
#shadow-root
<input type=text autoarialabelledby> <!-- delegates aria-labelledby to the host -->
</x-input>
<!-- reflection -->
<x-label id="foo">
#shadow-root reflects=ariaLabelledBy
<label reflectsAriaLabelledBy> <!-- reflects its "id" upward, in a sense -->
</x-label>
@nolanlawson
Copy link
Author

nolanlawson commented Jun 16, 2022

<x-listbox id="foo">
  #shadow-root reflects=ariaControls,ariaActiveDescendant
    <div role="listbox" reflectsAriaControls>
      <div role="option">One</div>
      <div role="option" reflectsAriaActiveDescendant>Two</div>
      <div role="option">Three</div>
    </div>
</x-listbox>

@nolanlawson
Copy link
Author

<!-- delegation -->
<x-input aria-labelledby="foo">
  #shadow-root
    <input type=text autoarialabelledby> <!-- delegates aria-labelledby to the host -->
</x-input>

<!-- reflection -->
<x-label id="foo">
  #shadow-root reflects=ariaLabelledBy
    <label reflectsAriaLabelledBy>content</label>
</x-label>

<label id="foo">content</label>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment