Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#15106 closed bug (notabug)

Preventing mouseup on the Chrome datepicker causes problems

Reported by: kevin-brown Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

Description

jQuery Version: 2.1.1, 2.0.3, 1.10.2

OS: Ubuntu 14.04 LTS
Browser: Chrome 34.0.1847.137 (Stable)

Short test case: http://jsfiddle.net/RpqEq/
Full test case: http://pastebin.com/da4EMTLQ

Working test case: http://jsfiddle.net/RpqEq/1/

Steps to reproduce:

  1. Load up the short test case
  2. Hover over the date picker (so the controls become visible)
  3. Click "An amazing button", observe that the click event is handled.
  4. Clear the value (using the "x" on the date picker)
  5. Click "An amazing button", observe that the click event is not handled.

Image demonstrating the issue: https://i.imgur.com/koCKFnx.gif

Details:

The mouseup event is being caught on the document and cancelled using return false;. Catching the mouseup event is causing Chromium to not fire click events on other object on the page. The same problems happen using evt.preventDefault(), but do not happen when the event is caught using addEventListener without jQuery.

Change History (3)

comment:1 Changed 8 years ago by dmethvin

Resolution: notabug
Status: newclosed

Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault() -- http://api.jquery.com/on/

http://jsfiddle.net/RpqEq/3/

comment:2 Changed 8 years ago by kevin-brown

Thanks for the response. I am aware that return false; just calls preventDefault (and stopPropagation, but that's not the issue). In the new fiddle, only stopPropagation is called and the issue does not appear (because it's a preventDefault issue). With preventDefault, the issue still happens.

http://jsfiddle.net/RpqEq/4/

Though, considering this happens without jQuery (I didn't realize preventDefault was part of standard events as well), should this be considered a possible Chromium issue, or am I missing something obvious?

http://jsfiddle.net/RpqEq/2/

comment:3 Changed 8 years ago by dmethvin

If this is only happening on Chrome, and it is happening without jQuery, and it seems like the behavior is wrong, then it sounds like a bug in Chrome. I see no behavior difference when you use both stopPropagation() and preventDefault()

http://imgur.com/F14BOLZ,8pKEC1L

Note: See TracTickets for help on using tickets.