Custom element extended built-in support and special `is` attribute
See original GitHub issuedocument.createElement
support additional options, namely is
for custom elements that are extended. You can see that no additional arguments are sent to document.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
and Html.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 string is
like the namespace
variable that applies it to document.createElement(tag, { is: is })
. It could then be exposed in Html
as a special case for Html.Attributes.is
or Html.extendedNode
.
This is related to Html
issue https://github.com/elm/html/issues/192
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:6 (1 by maintainers)
@enjoythelive1 According to https://discourse.elm-lang.org/t/calling-dom-methods-from-elm/5701/15 and https://caniuse.com/#search=custom elements, it’s not possible to customize built-in elements with the
is
syntax in Safari. If confirmed, this would lower significantly the interest of adding support for it.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.
https://bugs.webkit.org/show_bug.cgi?id=182671