Skip to main content

Bug Tracker

Side navigation

#10984 closed bug (fixed)

Opened December 09, 2011 10:15AM UTC

Closed December 14, 2011 02:42AM UTC

Last modified March 02, 2012 03:23PM UTC

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:
Blocked by: Blocking:
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

Attachments (0)
Change History (5)

Changed December 09, 2011 02:51PM UTC by njam comment:1

The demo was a bit flawed and not so understandable.

This should be better: http://jsfiddle.net/Y3jpM/5/

Changed December 09, 2011 03:01PM UTC by dmethvin comment:2

component: unfiledevent
milestone: None1.7.2
owner: → dmethvin
priority: undecidedhigh
status: newassigned

Verified, here's a simpler test case:

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

Changed December 14, 2011 02:42AM UTC by Dave Methvin comment:3

resolution: → fixed
status: assignedclosed

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

Changeset: c584ce4f562536a282c6ccfd78d5d12080850517

Changed January 07, 2012 02:05PM UTC by dmethvin comment:4

#11133 is a duplicate of this ticket.

Changed March 02, 2012 03:23PM UTC by dmethvin comment:5

#11428 is a duplicate of this ticket.