Skip to content

Commit

Permalink
Add support for shadow DOM closed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenle committed Sep 9, 2022
1 parent 5790765 commit 8e52b77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function register(Component, tagName, propNames, options) {
const inst = Reflect.construct(HTMLElement, [], PreactElement);
inst._vdomComponent = Component;
inst._root =
options && options.shadow ? inst.attachShadow({ mode: 'open' }) : inst;
options && options.shadow ? inst.attachShadow({ mode: options.mode || 'open' }) : inst;
return inst;
}
PreactElement.prototype = Object.create(HTMLElement.prototype);
Expand Down

0 comments on commit 8e52b77

Please sign in to comment.