Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11392 closed bug (invalid)

Trigger() after clone(true) doesn't fire events

Reported by: oyejorge Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2b1
Keywords: Cc:
Blocked by: Blocking:


Live events attached to cloned elements ( withDataAndEvents = true ) are not fired with trigger('click').

A simple demonstration: http://jsfiddle.net/AzujE/1/

Change History (4)

comment:1 Changed 11 years ago by oyejorge

Updated test case: http://jsfiddle.net/AzujE/3/

comment:2 Changed 11 years ago by Rick Waldron

Resolution: invalid
Status: newclosed

Use trigger("click")

comment:3 Changed 11 years ago by oyejorge

The recommended resolution of using trigger('click') doesn't work either as the jquery documentation suggests:

when .click() is called without arguments, it is a shortcut for .trigger("click").

Admittedly, the example on jsfiddle wasn't the best (it appears to fail with jQuery 1.6.4 as well) so I have updated it: http://jsfiddle.net/AzujE/5/

Run it with jQuery edge, then switch it over to 1.6.4 and you'll get two different results.

comment:4 Changed 11 years ago by Rick Waldron

You have to attach it... http://jsfiddle.net/rwaldron/AzujE/6/

Note: See TracTickets for help on using tickets.