Skip to content

child content being mishandled #32

@WebFreak001

Description

@WebFreak001

I want to mix an element and a text node so I tried the following code:

struct Elem
{
	mixin Node!"div";
	@prop innerText = "elem";
}

struct App
{
	mixin Node!"div";
	@prop innerText = "app";
	@child Elem elem;
}

mixin Spa!App;

and expected

app
<div>elem</div>

but instead got

app
<div>app</div>

which I can't explain to myself.

Changing one to textContent and the other to innerText (but not both the same) seems to fix this but that feels like a hack.

I thought maybe adding a @child something = "test"; instead of the innerText prop might be properly handled as text node, but instead that only gave me compilation errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions