#343 new

IE9 triggers onDrag/mousemove event when clicking a draggable

Reported by jimmy | February 28th, 2012 @ 11:35 AM


I've simply set up a draggable item on a page and in IE9 (using any browser mode) the onDrag event will be triggered when clicking on the draggable.

Test page attached. Uses latest prototype (1.7) and scriptaculous (1.9)

Oh, and note that for some silly reason that if you have more than one tab open in the browser, you will not see this issue. Close all other tabs and you'll see the full glory of IE9 -- i.e. you'll see the issue.


I've tried adding the line below to a page to see if it's just IE9 but it doesn't get triggered when clicking:
Event.observe(document, "mousemove", function(){console.log('xx')});

However if i change the hanlder for the mousemove event in the dragdrop.js file on line 138 to simply write something to the console (like above), it will trigger when the draggable is clicked.


#322: This one specifically mentions that onclick on sortables do not work.


Apart from having at least one other tab open, I've found that having a delay on the draggable helps. A delay of 150 seems to be enough for me.


Prototype: 1.7
Scriptaculous: 1.9
IE: 9.0.8112.16421
OS: Win 7

Comments and changes to this ticket

  • ronin-93814 (at lighthouseapp)

    ronin-93814 (at lighthouseapp) March 21st, 2012 @ 12:14 PM

    The problem is related to the call to window.focus() from within the mousedown handler in line 162. Apparently, that triggers another mousemove event on IE9 which will eventually lead to updateDrag . If I remove it, everything works as expected. Unfortunately, I'm not sure about the use case for which this line was added in the first place.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
<br/><b>Source available from github</b>
The Git repository resides at:
<a href="http://github.com/madrobby/scriptaculous">http://github.com/madrobby/scriptaculous</a>
<br/>Check out the current development trunk with:
<code>git clone git://github.com/madrobby/scriptaculous.git</code>
<br/>As <b>script.aculo.us 1.xx is feature-frozen</b>, this development trunk is for <b>bugfixes only</b>.
<br/>New development should happen only for
<b>script.aculo.us 2</b>.
<br/><b>Creating a bug report</b>
When creating a bug report, be sure to include as much relevant information as possible. Post a an example that shows off the problem. Preferably, <b>alter the unit tests</b> and show through either changed or added tests how the expected behavior is not occuring.

People watching this ticket


Referenced by