Coder Social home page Coder Social logo

Non mv-list-item children (<tr>s) get replicated when the mv-list is a <table> about mavo HOT 5 OPEN

karger avatar karger commented on July 17, 2024
Non mv-list-item children (s) get replicated when the mv-list is a

from mavo.

Comments (5)

LeaVerou avatar LeaVerou commented on July 17, 2024

Yeah, this is because the proper table structure assumes a <tbody>, and if you don't add that, the browser does. So by the time Mavo sees the structure of your HTML, it sees:

<div mv-app="appName" mv-mode="edit">
	Static trs are being replicated, as well as the "add item" buttons!
	<table mv-list="stuff" mv-initial-items="2">
		<tbody>
			<tr>
				<td>First</td>
				<td>Second</td>
			</tr>
			<tr mv-list-item>
				<td property="first"></td>
				<td property="second"></td>
			</tr>
			<tr>
				<td>First Footer</td>
				<td>Second Footer</td>
			</tr>
		</tbody>
	</table>
</div>

So it assumes the <tbody> is the item of the stuff list, and then you have an orphan mv-list-item. It tries to turn the latter into a list as well, by wrapping it with another <tbody>.

I'm tending to mark this as WONTFIX since there's no way to fix it — the original HTML structure cannot be recovered.

from mavo.

karger avatar karger commented on July 17, 2024

But, the original mv-list-item is still present, now as a grandchild of the mv-list. So why not have mavo replicate the grandchild?

from mavo.

LeaVerou avatar LeaVerou commented on July 17, 2024

What is the general rule here? Any descendant mv-list-item?

from mavo.

karger avatar karger commented on July 17, 2024

I would say any uninterrupted descendant---if there's an intervening mv-list then of course that should take precedence. Put another way mv-list-item should tie to the closest mv-list ancestor.

from mavo.

LeaVerou avatar LeaVerou commented on July 17, 2024

If creating lists with just mv-list or just mv-list-item becomes commonplace (rather than just error recovery), I don't think we can assume that was the author's intent.

from mavo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.