Skip to content

Hot reload causing template to drop class attribute #351

@Bananas-Are-Yellow

Description

@Bananas-Are-Yellow

I have a template file that contains two templates:

<template id="Section">
    <p class="panel-heading is-size-7 p-1 is-radiusless">
        ${Title}
    </p>
</template>

<template id="NoteCard">
    <div class="note-card">
    ...

These templates are instantiated several times on the page.

The content is client-side generated. Initially, the page displays correctly but when I interact with the page to cause it to update, instances of the first template used have the class attribute missing. So, instead of this:

<p class="panel-heading is-size-7 p-1 is-radiusless">
    My Title
</p>

I get this:

<p>
    My Title
</p>

My code uses the Section template first, so this is the one that shows the problem. But if I copy the HTML and create a template from a plain string instead, then the NoteCard template is the one that has the problem and the class="note-card" attribute missing.

The problem only occurs if hot reloading is enabled. To disable hot reloading, I can build a Release configuration, or I can comment out the hot reloading code (AddHotReload, UseHotReload, and Program.withHotReload).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions