NoRyb NoRyb - 1 year ago 283
jQuery Question

Internet Explorer 11: MouseUp triggered on Scrollbar-MouseDown

To workaround a problem that a scrollbar-click caused an onBlur-Event I used "mousedown" to flag the click as "inside" my div and on mouseup I would reset the flag.

I'm not sure since when (an update?) this behaviour doesn't work anymore. I've created a fiddle to demonstrate this:

$(document).mousedown(function (documentEventObject) {
$(document).mouseup(function (documentEventObject) {

If you use chrome, the mouseup event fires, when you release the mouse-button on the scrollbar. In IE 11, the mouseup event fires together with the mousedown event... Did anyone experience the same problem?


  • Internet Explorer 11.0.10240.16431, Updateversion: 11.0.22 (KB3078071)

  • Windows 10

Interestingly I also have a Windows 7 Laptop with IE 11.0.9600.18059 installed. There I only get the mousedown message in console (no mouseup even when I release the button)!

Answer Source

I solved my issue (not losing focus of my input when the scrollbar is clicked) with a timer instead of the mouseup:

var mouseDownWasInMyDiv = false;

$(myDiv).mousedown(function () {
  mouseDownWasInMyDiv = true;
  setTimeout(function() {
    mouseDownWasInMyDiv = false;
  }, 0);

$(myInput).blur(function () {
  if (mouseDownWasInMyDiv) {
    mouseDownWasInMyDiv = false; // should be set in Timeout but can also happen without click (e.g. TAB)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download