Bug Tracker

Opened 11 years ago

Closed 11 years ago

#12472 closed bug (invalid)

Window on event mouseup body selector no longer working

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:

Description

  1. Latest 1.8.1 (this code was working on 1.8.0, I verified it)
  2. Latest Chrome 21 (although my colleague informed me it is not reproducible in IE 9, but I cannot verify his claim)
  3. OSX 10.8
  4. Use the following code:

$('body').addClass('has-active-menu'); $(window).on('mouseup', 'body.has-active-menu', function () { alert('test'); });

Then click anywhere on the screen, nothing happens. You can try mousedown too, doesn't work either.

  1. This code worked in 1.8.0 and 1.7, it is valid code (delegation of the window/html tag to the body tag). My expectation is that alert will fire.

Change History (1)

comment:1 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

You should be using document. That is the highest point that supports delegated events. The fact that it used to work with window doesn't mean it was meant to work.

Note: See TracTickets for help on using tickets.