Bug Tracker

Modify

Ticket #5856 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

namespaced events remain on DOM object when calling remove()

Reported by: martinbraun Owned by:
Priority: minor Milestone: 1.4.1
Component: core Version: 1.4
Keywords: Cc:
Blocking: Blocked by:

Description

There is a problem with deregistering handlers when an element is removed from the DOM. Executing the following code leads to the problem:

jQuery("#somediv").bind("click.namespace1",function(){ alert("click!"); }); jQuery("#somediv").remove();

While the events object in the element's data object is deleted correctly, the generic event handler remains registered on the element -> removeEventListener()/detachEvent() is not called.

Change History

comment:1 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed
  • Version changed from 1.3.2 to 1.4
  • Component changed from unfilled to core

comment:2 Changed 2 years ago by jaubourg

Fixes #5856. Adds document protocol at the beginning of URLs without protocol (thanks go to skrings for the initial pull request). Simplifies cross-domain detection regexp and logic as a consequence. Also took the opportunity to remove an unused variable. Unit test added.

Changeset: 0e5b341cc0f3f9bf0f6659e09704f2267cfdfdba

comment:3 Changed 2 years ago by jaubourg

Wrong bug number in the commit :(

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.