Skip to main content

Bug Tracker

Side navigation

#5566 closed bug (fixed)

Opened November 30, 2009 07:33AM UTC

Closed December 12, 2010 07:51PM UTC

Last modified December 13, 2010 02:49AM UTC

domManip fails to copy events when cloning elements

Reported by: dalangalma Owned by: snover
Priority: blocker Milestone: 1.5
Component: manipulation Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

I am creating a "button" element, adding a click handler to it, then attaching it to every one of multiple "li" elements by selecting all of the "li"s and appending the "button" element. When I do that, none of the buttons retain their click element. This worked in jQuery 1.2.6, then broke in 1.3.1 (see #3966 and #4161). I've verified the problem with the attached demo in jQuery 1.3.2 and a build from GitHub from 11/29/09.

Attachments (2)
Change History (13)

Changed December 08, 2009 04:41AM UTC by dalangalma comment:1

Changed December 16, 2009 02:01AM UTC by dmethvin comment:2

Still a problem in 1.4a1. domManip uses DOM cloneNode when appending to multiple elements, that looks like where the events are dropped. It looks like cloneCopyEvent might come in handy.

Changed November 17, 2010 05:57AM UTC by dalangalma comment:3

This is still broken on 1.4.4 though by now it's been regressed for so long that maybe the docs just need to be updated.

Changed November 20, 2010 09:54PM UTC by snover comment:4

milestone: 1.41.5
priority: majorblocker
status: newopen
version: 1.3.21.4.4

This should work.

Changed December 04, 2010 06:12AM UTC by snover comment:5

#6997 is a duplicate of this ticket.

Changed December 04, 2010 06:13AM UTC by snover comment:6

component: coremanipulation
milestone: 1.51.4.5
owner: → snover
status: openassigned
summary: Can't create an element, assign an event handler, then append it to multiple elements.domManip fails to copy events when cloning elements

Changed December 07, 2010 01:58AM UTC by snover comment:7

Changed December 09, 2010 05:44PM UTC by john comment:8

resolution: → fixed
status: assignedclosed

Landed.

Changed December 09, 2010 06:28PM UTC by jeresig comment:9

Backing out cec68e2b00d86357c18b576cbaed52cc1ea42a74, was causing serialize tests to fail. Un-fixes #5566.

Changeset: 29616e60c88bf300f4b2ee4ad1a89a8ac6481027

Changed December 09, 2010 06:28PM UTC by john comment:10

resolution: fixed
status: closedreopened

Changed December 12, 2010 07:51PM UTC by Colin Snover comment:11

resolution: → fixed
status: reopenedclosed

Merge branch 'bug5566' into csnover-bug5566. Fixes #4386, #5566, #6997.

Conflicts:

src/manipulation.js

test/unit/manipulation.js

Changeset: 4fae75d575b20d887e4a273c7991c55f8821a62c

Changed December 13, 2010 02:49AM UTC by snover comment:12

#4383 is a duplicate of this ticket.

Changed January 14, 2011 10:20PM UTC by jitter comment:13

milestone: 1.4.51.5

Move fixed tickets to appropriate milestone