Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10437 closed bug (invalid)

.remove() method used on cloned [.clone(true)] element unbind events from original element

Reported by: bumper Owned by: bumper
Priority: low Milestone: None
Component: manipulation Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:

Description

hi, I find this annoying bug.

When I clone element with ".clone(true)" method, then I remove it with ".remove()", it unbind all events from original element. When ".detach()" was used for removing it's ok, but it shouldn't work that way.

Change History (4)

comment:1 Changed 8 years ago by Rick Waldron

Component: unfiledmanipulation
Owner: set to bumper
Priority: undecidedlow
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:3 Changed 8 years ago by allan.jardine@…

I've just stumbled across this as well. I've created a JSFiddle which shows the issue: http://jsfiddle.net/2jFDd/2/ .

Note that this problem occurs only in IE6/7 and only if you use the DOM method cloneNode - it does not occur if you use $().clone. IE8+ and all other browsers appear to get this right, so it looks to me that internally when cloning nodes IE is keeping a reference to the original :-(.

comment:4 Changed 8 years ago by dmethvin

If you use oldIE DOM.cloneNode() directly then yes, that will circumvent all the hard work jQuery does for you under the covers. So don't do that.

Note: See TracTickets for help on using tickets.