Skip to main content

Bug Tracker

Side navigation

#14264 closed bug (invalid)

Opened August 16, 2013 02:42PM UTC

Closed September 09, 2013 08:51AM UTC

Click event lost if element content changes mid-click

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.2
Keywords: Cc:
Blocked by: Blocking:
Description

If the content of an element changes between mouse mouse down and mouse up then the click event seem to not fire.

Repro here

Attachments (0)
Change History (5)

Changed August 16, 2013 02:50PM UTC by sergioafp comment:1

I submitted this. Sorry, forgot to login first.

Changed August 20, 2013 05:47PM UTC by dmethvin comment:2

owner: → anonymous
status: newpending

Does the problem also occur with bare DOM methods like addEventListener? If so the event just isn't happening. Please create a test case without jQuery and let us know.

Changed August 23, 2013 07:50PM UTC by sergioafp comment:3

The issue has more to do with $.html('new content') than with the event code. I've updated my repro (http://jsfiddle.net/apEbX/5/). Note how the problem happens with addEventListener as well but it goes away if I don't use jQuery to update the element's content.

Changed August 26, 2013 03:03AM UTC by dmethvin comment:4

A few more test cases to narrow it down. Note that the original case is passing a *number* to .html() and not a string. Once it's a string the method goes through the .innerHTML path and works as expected. However I haven't looked at why it would break, the bare DOM case should be similar to the .empty().append() case.

http://jsfiddle.net/apEbX/6/

Changed September 09, 2013 08:51AM UTC by trac-o-bot comment:5

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!