Skip to content

Commit

Permalink
span
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed May 12, 2023
1 parent 1be26a4 commit ade43e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/js/in-open-shadow-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ module.exports = () => {
}
}

class CustomSpan extends HTMLElement {
constructor() {
super();

this.attachShadow({ mode: 'open' }).innerHTML = '<span><slot></span></button>';
}
}

class FocusTrapModal extends HTMLElement {
constructor() {
super();
Expand All @@ -24,6 +32,7 @@ module.exports = () => {
<p>
<custom-button>Shadow Button</custom-button>
<button>Light DOM Button</button>
<custom-span>Shadow Span</custom-span>
<button id="deactivate-in-open-shadow-dom" aria-describedby="in-open-shadow-dom-heading">
deactivate trap
</button>
Expand Down Expand Up @@ -57,4 +66,5 @@ module.exports = () => {

customElements.define('focus-trap-modal', FocusTrapModal);
customElements.define('custom-button', CustomButton);
customElements.define('custom-span', CustomSpan);
};

0 comments on commit ade43e5

Please sign in to comment.