Bug Tracker

Modify

Ticket #10984 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Cannot off() custom events ($.event.special)

Reported by: njam Owned by: dmethvin
Priority: high Milestone: 1.7.2
Component: event Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

Hi,

I'm trying to unbind a "custom event" ($event.special) with off(). This doesn't seem to work, if I supply the original callback in addition to the event-name:

$(".bar").off("clickFoo"); // works
$(".bar").off("clickFoo", fn); // doesn't work

Demo:  http://jsfiddle.net/Y3jpM/2/

Is this a bug, or am I doing something wrong?

Sincerely

Change History

comment:1 Changed 2 years ago by njam

The demo was a bit flawed and not so understandable. This should be better:  http://jsfiddle.net/Y3jpM/5/

comment:2 Changed 2 years ago by dmethvin

  • Owner set to dmethvin
  • Priority changed from undecided to high
  • Status changed from new to assigned
  • Component changed from unfiled to event
  • Milestone changed from None to 1.7.2

Verified, here's a simpler test case:

 http://jsfiddle.net/dmethvin/Y3jpM/6/

comment:3 Changed 2 years ago by Dave Methvin

  • Status changed from assigned to closed
  • Resolution set to fixed

Fix #10984. Use origType when unbinding via the event object.

Changeset: c584ce4f562536a282c6ccfd78d5d12080850517

comment:4 Changed 2 years ago by dmethvin

#11133 is a duplicate of this ticket.

comment:5 Changed 2 years ago by dmethvin

#11428 is a duplicate of this ticket.

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.