Skip to main content

Bug Tracker

Side navigation

#11392 closed bug (invalid)

Opened February 26, 2012 05:27AM UTC

Closed February 26, 2012 06:08AM UTC

Last modified February 27, 2012 02:06AM UTC

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:
Description

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

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

Attachments (0)
Change History (4)

Changed February 26, 2012 05:32AM UTC by oyejorge comment:1

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

Changed February 26, 2012 06:08AM UTC by rwaldron comment:2

resolution: → invalid
status: newclosed

Use trigger("click")

Changed February 26, 2012 06:18PM UTC by oyejorge comment:3

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.

Changed February 27, 2012 02:06AM UTC by rwaldron comment:4

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