Skip to main content

Bug Tracker

Side navigation

#13647 closed bug (notabug)

Opened March 22, 2013 09:00AM UTC

Closed March 22, 2013 11:45AM UTC

Last modified March 24, 2013 01:48AM UTC

Duplicate tbody when inserting row into table

Reported by: cod@iresults.li Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0b1
Keywords: Cc:
Blocked by: Blocking:
Description

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

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

Attachments (0)
Change History (6)

Changed March 22, 2013 11:45AM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

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

Changed March 22, 2013 12:42PM UTC by cod@iresults.li comment:2

If I don't do something extremely wrong here, I think appending to the tbody makes it even worse:

http://jsfiddle.net/q9HYu/3/

Changed March 24, 2013 01:17AM UTC by m_gol comment:3

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/

Changed March 24, 2013 01:20AM UTC by m_gol comment:4

Here you can see that the inner structure is set correctly:

http://jsfiddle.net/q9HYu/8/

Changed March 24, 2013 01:31AM UTC by m_gol comment:5

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

Line 315 of manipulation.js handle this:

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

Changed March 24, 2013 01:48AM UTC by m_gol comment:6

(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)