Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13647 closed bug (notabug)

Duplicate tbody when inserting row into table

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0b1
Keywords: Cc:
Blocked by: Blocking:


When inserting a new <tr> into a table a new <tbody> will be inserted.

See: http://jsfiddle.net/q9HYu/

Change History (6)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

If you want the tr to go into the existing tbody then append it there.

comment:2 Changed 10 years ago by [email protected]

If I don't do something extremely wrong here, I think appending to the tbody makes it even worse: http://jsfiddle.net/q9HYu/3/

comment:3 Changed 10 years ago by m_gol

This works correctly on current jQuery 2.0 from git, although behaviour of jQuery 2.0b1 is, indeed, erroneous.

Could you advocate to jsFiddle somehow so that they introduce a jQuery 2.x edge option? It would be extremely useful...

Anyway, an updated test case with the current jQuery 2.0.0-pre: http://jsfiddle.net/q9HYu/7/

comment:4 Changed 10 years ago by m_gol

Here you can see that the inner structure is set correctly: http://jsfiddle.net/q9HYu/8/

comment:5 Changed 10 years ago by m_gol

Btw, working on table instead of tbody works, too: http://jsfiddle.net/q9HYu/9/

Line 315 of manipulation.js handle this:

	table && jQuery.nodeName( this[ i ], "table" ) ?
		findOrAppend( this[ i ], "tbody" ) :
		this[ i ],

comment:6 Changed 10 years ago by m_gol

(a little OT but related to what I wrote before - I created a ticket for adding jQuery 2.x edge lib to jsFiddle: https://github.com/jsfiddle/jsfiddle-issues/issues/355)

Note: See TracTickets for help on using tickets.