Skip to main content

Bug Tracker

Side navigation

#15106 closed bug (notabug)

Opened May 22, 2014 05:55PM UTC

Closed May 22, 2014 06:51PM UTC

Last modified May 22, 2014 08:08PM UTC

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.

Attachments (0)
Change History (3)

Changed May 22, 2014 06:51PM UTC by dmethvin comment:1

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/

Changed May 22, 2014 07:25PM UTC by kevin-brown comment:2

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/

Changed May 22, 2014 08:08PM UTC by dmethvin comment:3

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