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

Custom Transformations don't work when rendered in <slot> #118

Closed
rijkvanzanten opened this issue Feb 26, 2023 · 3 comments
Closed

Custom Transformations don't work when rendered in <slot> #118

rijkvanzanten opened this issue Feb 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rijkvanzanten
Copy link

rijkvanzanten commented Feb 26, 2023

Say we have a global collection seasons, when using the Template Syntax, it renders the names of the seasons as expected:

<template webc:type="11ty" 11ty:type="njk">
	{%- for season in seasons -%}
	<h2>{{ season.name }}</h2>
	{%- endfor -%}
</template>

However, when this same block is used within another WebC component, it doesn't render anything:

<!-- oh-no.webc -->
<div></slot></div>

<!-- index.webc -->
<oh-no>
	<template webc:type="11ty" 11ty:type="njk">
		{%- for season in seasons -%}
		<h2>{{ season.name }}</h2>
		{%- endfor -%}
	</template>
</oh-no>

Changing the template to a div makes it render the string contents of the njk, making me believe that the webc:type and 11ty:type attributes are ignored in render 🤔

@rijkvanzanten
Copy link
Author

Using the same block nested in a regular html element works as expect (f.e. when you replace <oh-no> with <div>)

@zachleat zachleat added the bug Something isn't working label Mar 7, 2023
@zachleat
Copy link
Member

zachleat commented Mar 7, 2023

I reproduced this one 👍🏻

@zachleat zachleat added this to the WebC v0.11.3 milestone Apr 6, 2023
@zachleat zachleat self-assigned this Apr 6, 2023
@zachleat
Copy link
Member

zachleat commented Apr 6, 2023

Shipping with 0.11.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants