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

Child elements not added to <template> elements #185

Open
cdfa opened this issue Feb 27, 2023 · 0 comments
Open

Child elements not added to <template> elements #185

cdfa opened this issue Feb 27, 2023 · 0 comments

Comments

@cdfa
Copy link

cdfa commented Feb 27, 2023

Elm fails to construct HTML <template> elements, probably because you're supposed to call appendChild and such on the element's content property instead of the element itself.

Example:

import Html exposing (..)

view =
	node "template" [] [
		p [] [ text "Test" ]
	]

This will result in a <template> element with an empty #document-fragment in Firefox (109.0.1). In Chrome (110.0.5481.100) the p gets added outside of the #document-fragment, which isn't right either.

cdfa pushed a commit to cdfa/zotonic that referenced this issue Feb 27, 2023
…ly more general

This allows strict frontend frameworks like Elm to replace the `<script>` with some other element and still have it work.
Ideally, we would use a `<template>` instead of a `<script>`, but that also causes problems in Elm at the moment: elm/virtual-dom#185
mworrell pushed a commit to zotonic/zotonic that referenced this issue Feb 28, 2023
…ly more general (#3308)

This allows strict frontend frameworks like Elm to replace the `<script>` with some other element and still have it work.
Ideally, we would use a `<template>` instead of a `<script>`, but that also causes problems in Elm at the moment: elm/virtual-dom#185

Co-authored-by: Colin de Roos <[email protected]>
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

1 participant