Bug Tracker

Opened 9 years ago

Closed 9 years ago

#9382 closed bug (worksforme)

Click isn't triggered with mouse but it's ok by code

Reported by: laligatz@… Owned by: laligatz@…
Priority: low Milestone: 1.next
Component: unfiled Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

I am trying to develop a large application in JS and I have some menus interactions. All was working fine with jQuery 1.5.2, but with jQuery 1.6.1, the click binding on my menu doesn't work. After investigations, the moment where I bind the click event just after the creation of the <a/> tag no longer seems to be the right place. If I do the bind *after* all the stuff was done, in Firebug for example, it works. What i do not understand it's why. If I dump the element, i see its click event attached in the data property. Even if i do mymenu.click() in the console, it's working. But a real click with my mouse doesn't !

I've tried to use promise().done(function{}) sequence for building my HTML elements, but without success.

I've spent a lot of hours to try to understand what is going wrong. I'll have to change the logic of my menus creation but I don't know if I'm missing something or if i found a bug in jQuery.

Change History (3)

comment:1 Changed 9 years ago by addyosmani

Owner: set to laligatz@…
Priority: undecidedlow
Status: newpending

Thanks for submitting a ticket to the jQuery Project. We're unfortunately unable to assist with debugging problems that haven't been reduced down to a runnable test case, however if you're able to supply us with this (via http://jsfiddle.net), we'll do our best to evaluate whether this is an issue with jQuery core or not.

comment:2 Changed 9 years ago by anonymous

Ok, i've just found the solution.

I clone my anchor and i lost the event click at this time. With .clone(true, true), everything is working. But with jQuery 1.5.1, no need to set true to clone() function, the events are still copied. Perhaps, it was a bug which has been fixed !

comment:3 Changed 9 years ago by Rick Waldron

Resolution: worksforme
Status: pendingclosed

That was a mistake that *I* caused in the clone() rewrites, where I handled the args backwards. The issue was detected after the code shipped and was quickly patched. Sorry for the confusion and inconvenience.

Note: See TracTickets for help on using tickets.