Bug Tracker

Opened 6 years ago

Closed 6 years ago

#9522 closed bug (wontfix)

Cannot use .append() or .appendTo() with document fragments

Reported by: magentix@… Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

As the title states: trying to append() a document fragment OR trying to appendTo() onto a document fragment fails.

The fragment will not have any children in the example below:

var frag = document.createDocumentFragment(),
    elem = document.createElement('div');
	
/* Comment out 2 out of 3 to test each case separately */
	
//frag.appendChild(elem);
$(frag).append(elem);
//$(elem).appendTo(frag);
	
console.log(frag);

Change History (4)

comment:1 Changed 6 years ago by dmethvin

Component: unfiledmanipulation
Priority: undecidedlow
Status: newopen

fiddle: http://jsfiddle.net/barfD/

barfD, lol.

comment:2 Changed 6 years ago by timmywil

Is that something we want to fix? Fragments are nodeType 11 and all manipulation is revolved around nodeType being 1.

comment:3 Changed 6 years ago by Rick Waldron

@dmethvin & @timmywil - I vote "invalid use case".

comment:4 Changed 6 years ago by addyosmani

Resolution: wontfix
Status: openclosed

Adding a +1 to rwaldron's vote to mark this as an invalid use case. As timmywil appears to side with this not being behaviour that should be fixed, I'll be closing as wontfix.

If another member of the team wishes to change this resolution, please feel free to.

Note: See TracTickets for help on using tickets.