#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 11 years ago by
Component: | unfiled → manipulation |
---|---|
Owner: | set to bumper |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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 11 years ago by
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 11 years ago by
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.
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.