-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Error extending native elements in Safari #17
Comments
There is a statement.
|
Actually, I am in doubt if extending native elements works at all in Safari. I guess, the current Candid implementation of ES5-style classes is correct. Here is code that uses ES6-style classes and should work according to the spec. ChromeSafari |
It looks like I am right - Safari does not (and probably will never) support customizable built-in elements. Furthermore:
|
Quick fix: include this polyfill <!-- this should be on top of your HTML <head> scripts -->
<!-- it fixes customized built-in element in Safari and older browsers -->
<script src="//cdn.jsdelivr.net/npm/@ungap/custom-elements"></script> Strategy / design decisions
|
Core issue: create a custom element which is a subclass of a native DOM element using the ES5 prototype chain. Current problem is the instantiation using new().
customElements
. webcomponents/polyfills#108 (comment)Looks like lit.dev does not support it. One more reason for us to do it!
This thread
https://dev.to/lkraav/comment/ad06
Browser support
See caniuse.com.
As of 2022-02-02
Solution / workaround
The text was updated successfully, but these errors were encountered: