Ticket #7114 (closed bug: duplicate)
$(element).data({...}) erases events
| Reported by: | Vic D'Elfant | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.4.3 |
| Component: | data | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
We had a specific issue in which events which were bound to an element somehow disappeared between the actual binding and the triggering of said event.
After hours of debugging, we found out that the events were erased by a data({...}) call on the same event (so with an array of key-value pairs instead of single calls). This is obviously due to jQuery using the "events" data element for storing events. In our opinion, jQuery's data() function should leave the "events" data element intact because it is far from obvious that providing an array will override *everything*, including internal data.
Test case is attached to this ticket.
Attachments
Change History
Changed 3 years ago by Vic D'Elfant
-
attachment
jquery-event-data-poc.htm
added
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Proof of Concept