Skip to content

Container cannot go inside a tbody #1

Description

@johnaweiss

This bug affects group-header templates.

A span inside a tbody is invalid HTML. A tbody tag cannot support span tags as direct children, only tr tags. Therefor , the following will fail:

HTML

<template id="test">
<table>
	<tbody>
		<!-- CONTAINER FOR ITEMS -->
		<span hidden mt-template="team-member" mt-records="[[RECORDS]]"></span>
	</tbody>
</table>'
</template>

JS

const tb = document.querySelector("#test");
console.log (tb.innherHTML);    // fails

The innerHTML property of the template will actually move the span outside of the table, and place it above the table.

Result of tb.innerHTML

<span hidden mt-template="team-member" mt-records="[[RECORDS]]"></span>
<table>
	<tbody>
		<!-- CONTAINER FOR ITEMS -->
	</tbody>
</table>'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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