Bug Tracker

Modify

Ticket #4643 (closed bug: worksforme)

Opened 4 years ago

Last modified 3 years ago

clone(true) bug with multiple nested elements

Reported by: balazs.endresz Owned by:
Priority: major Milestone: 1.4
Component: manipulation Version: 1.3.2
Keywords: clone, find Cc:
Blocking: Blocked by:

Description

Running jQuery("p").find("*").clone(true); in the attached file produces this error: orig[i] is undefined

inside the clone method ret.find("*").andSelf() returns the abbr element twice, which is a child of another one in the set

Attachments

jquery_clone_bug.html Download (926 bytes) - added by balazs.endresz 4 years ago.

Change History

Changed 4 years ago by balazs.endresz

comment:1 Changed 4 years ago by balazs.endresz

The problem seems to be that the abbr node is present in the original set and it's also a child node of another element in the same set, so it gets cloned twice, thus jQuery.unique thinks we've got two of them. I guess there's no easy or efficient way to fix it.

comment:2 Changed 3 years ago by dmethvin

  • Component changed from unfiled to manipulation

comment:3 Changed 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to worksforme

 test case works for me.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.