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

fix: Nested template renders when it shouldn't in fast-element #6816

Open
m-akinc opened this issue Aug 17, 2023 · 1 comment
Open

fix: Nested template renders when it shouldn't in fast-element #6816

m-akinc opened this issue Aug 17, 2023 · 1 comment
Labels
area:fast-element Pertains to fast-element

Comments

@m-akinc
Copy link
Contributor

m-akinc commented Aug 17, 2023

🐛 Bug Report

If the first thing in a multiline template (created using html) is another template, that nested template renders at times when it shouldn't.

E.g.

html`${html`foo`}
  `

Note that whitespace in the outer template affect whether this occurs or not. If there are no linebreaks (e.g. html`${html`foo`}` ) everything works properly. If there is a space/linebreak before the nested template in a multi-line template, everything works. E.g.

html`
   ${html`foo`}
`

💻 Repro or Code Sample

See Stackblitz

🤔 Expected Behavior

The inner template should not be rendered (when, say, the outer template is excluded by a when condition).

😯 Current Behavior

The inner template keeps getting rendered, even when the rest of the containing template does not.

🔦 Context

Ran into this bug when authoring a custom component that uses a nested template.

@m-akinc m-akinc added the status:triage New Issue - needs triage label Aug 17, 2023
@nicholasrice nicholasrice added area:fast-element Pertains to fast-element and removed status:triage New Issue - needs triage labels Aug 22, 2023
@nicholasrice
Copy link
Contributor

Thanks for reporting @m-akinc.

It looks like this is only affecting v1, no repro v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-element Pertains to fast-element
Projects
None yet
Development

No branches or pull requests

2 participants