-
Notifications
You must be signed in to change notification settings - Fork 80
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
Custom element extended built-in support and special is
attribute
#156
Comments
is
attribute.is
attribute
From reading the docs on the The first is The second idea is to go with the I do think the first option provides a more clear idea of what's going on. The user is modifying their element in an atypical manner. It's also more obvious to a person who is coming into a large code base for the first time and trying to understand why their element is behaving in a way that isn't typical of an element with that name. |
I do not have enough insight to be a proponent of any specific implementation, hence not just adding +1 to the OP. But I do want to +1 fixing extending standard HTMLElement via Web Components. @jreusch made an example (for fun, not for real usage), https://ellie-app.com/8LXM8GVGxWWa1 Ref: https://discourse.elm-lang.org/t/calling-dom-methods-from-elm/5701/7 @pdamoc made an example of how it might look like, if there is support for validity =
attribute "validity" Documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validity |
Is anybody working on this or is this in active discussion? I would like to collaborate |
@enjoythelive1 According to https://discourse.elm-lang.org/t/calling-dom-methods-from-elm/5701/15 and https://caniuse.com/#search=custom%20elements, it's not possible to customize built-in elements with the |
I'm having difficulty finding the source task that was for implementing |
On the discussion about the Safari issue it is recomended to use a polyfill (https://github.com/ungap/custom-elements) which not only makes it work on Safari but also on older versions of other browsers. |
The extension of build in elements works perfectly fine in Safari with the polyfill. It is really a pity that there is no way to make it work in Elm, |
document.createElement
support additional options, namelyis
for custom elements that are extended. You can see that no additional arguments are sent todocument.createElement
.Since custom elements are a goto solution for when limitations of Elm are crossed, allowing more support for them would be worthwhile. I tried in vain both using
Html.Attributes.property
andHtml.Attributes.attribute
because it must be set on element creation .I would suggest similar to
_VirtualDom_nodeNS
, to have_VirtualDom_nodeIs
or_VirtualDom_extendedNode
that takes a stringis
like thenamespace
variable that applies it todocument.createElement(tag, { is: is })
. It could then be exposed inHtml
as a special case forHtml.Attributes.is
orHtml.extendedNode
.This is related to
Html
issue elm/html#192The text was updated successfully, but these errors were encountered: