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

A proof-of-concept fix for Custom Element Overrides #3184

Closed

Conversation

taylorhadden
Copy link

This is a proof-of-concept change that fixes the issues with Custom Element Overrides detailed in issue #3182 where using the "is" property to define a native element overridden with a custom element does not work as expected.

The code is a bit of a cludge right now, as it's my first stab into this environment. As of 10554c9, it does not support binding the "is" property to an Expression. It would seem to me that in order to support this, one would have to remove and recreate the element entirely to support it correctly, and I do not know how to go about doing that.

Any feedback, tips, or admonishment welcome.

@Rich-Harris
Copy link
Member

Thank you! I took another run at it in #3418, as I felt there were a couple of small tweaks we needed to make:

  • supporting expressions (though this doesn't support expressions that change, which I think is probably ok)
  • since is="" is somewhat rare, it's probably better to create a separate element_is helper, so that it doesn't increase bundle size for people not using it
  • add a warning, since Safari will never support this feature, which means that it should be avoided

Closing in favour of that PR

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

Successfully merging this pull request may close these issues.

2 participants