Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing support for web components #60

Open
mattlohkamp opened this issue Feb 6, 2020 · 2 comments
Open

missing support for web components #60

mattlohkamp opened this issue Feb 6, 2020 · 2 comments

Comments

@mattlohkamp
Copy link

As written, this polyfill only addresses <detail> support in the light DOM - i.e. <style>s added to document.head will not apply to elements encapsulated in the shadow DOM that comes standard with web components.

Just off the top of my head, allowing the polyfill functionality to be manually initialized with context passed in as an argument, might be a fairly direct fix - make the master function an export, and the implementation looks something like this:

import dePolyfill from 'details-element-polyfill';
window.customElement.define('my-element', class MyElement extends HTMLElement {
 this.attachShadow({mode:'open');
 dePolyfill(this.shadowRoot);
});
@javan
Copy link
Owner

javan commented Feb 17, 2020

Out of curiosity, are there browsers with Shadow DOM support that don't support <details>?

@mattlohkamp
Copy link
Author

mattlohkamp commented Feb 17, 2020

I don't think so. I need to support IE11 so I'm knee-deep in polyfill land though. 😓

edit - and actually, a lot of default windows 10 installation users are still stuck with Edge v44, which needs polyfills for web components and details/summary element stuff as well. Once Edge v79+ is a compulsory windows update that'll start to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants