NoRyb NoRyb - 4 months ago 51x
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)!


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)