Bug Tracker

Modify

Ticket #11580 (closed bug: invalid)

Opened 14 months ago

Last modified 14 months ago

unbind with added spaces unbinds everything, not just the namespaced events.

Reported by: scott.vanlooy@… Owned by:
Priority: low Milestone: None
Component: event Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

Test code: $(window).unbind(); $(window).bind('click', function () {

console.log('test')

}); $(window).bind('click.test1', function () {

console.log('test ns 1')

}); $(window).bind('click.test2', function () {

console.log('test ns 2')

}); $(window).unbind('click.test1 click.test2');

You'd expect this to still console log 'test' but it doesn't, because there's an extra space in the unbind. This worked in jQuery 1.6

Change History

comment:1 Changed 14 months ago by scott.vanlooy@…

 http://jsfiddle.net/MbLnK/ (sorry, should've read the guidelines first!)

comment:2 Changed 14 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to event

Even though it worked in 1.6 doesn't necessarily mean it's an regression.

.on() docs:

One or more space-separated event types...

This usually means one space separator. I can't think of any reason you'd want to use more than one space.

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.