Side navigation
#4161 closed bug (duplicate)
Opened February 16, 2009 08:07AM UTC
Closed February 18, 2009 04:22PM UTC
Event handlers not preserved when appending to multiple elements
Reported by: | dalangalma | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | core | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In jQuery 1.3.1, if you create a new element, attach an event handler to it, and then append it to multiple elements, all but the first copy of the element lose their event handlers. This worked in 1.2.6.
There's a demo at http://brh.numbera.com/experiments/browserdemos/jquery-1.3.1-append-handlers.html - I've attached a copy to this ticket.
Attachments (1)
Change History (3)
Changed February 17, 2009 12:16AM UTC by comment:1
owner: | → john |
---|
Changed February 18, 2009 01:39PM UTC by comment:2
There's an other important detail about this bug:
In 1.2.6 .append() leaves the source/prototype element intact when appending to multiple target elements...
In 1.3.1 the source/prototype element is always *moved* to the first target element...
See demo attached to ticket #4174
IMO this needs to be fixed as well
This does seem like a regression. The 1.3.1
is using the DOM method which doesn't carry over events. In 1.2.6 it used the jQuery method which does.