0

I'm experiencing an issue with chromes click behavior. There are cases (havnt been able to isolate the exact conditions, maybe dragging, dblclick, too quick... no idea) chrome will stop triggering the onmouseup event, as one can see in the dbg textarea. Tested the issue on ff and ie, which works fine. I did, however, notice that there is a workaround by setting the return value to false. This isn't useful on a website as this would disable any clicking action... Searched every corner of the web without luck :S

Heres the code:

<!DOCTYPE HTML>
<html>
<head>
    <title></title>
    <script type="text/javascript">
        window.onload = function () {
            document.onmousedown = function (e) {
                document.getElementById("dbg").innerHTML += "mousedown -\n";
                return true;
            };
            document.onmouseup = function (e) {
                document.getElementById("dbg").innerHTML += "mouseup -\n";
                return true;
            };
        }
    </script>
</head>
<body>
    <textarea id="dbg" cols="30" rows="10"></textarea><br>
</body>
</html>

Version: Chrome 16.0.912.75 m Any ideas? Many thanks

ankitkanojia
  • 3,072
  • 4
  • 22
  • 35
user1137619
  • 77
  • 2
  • 7
  • 1
    Works fine for me on 16.0.912.75: http://jsfiddle.net/XrHME/ . – glortho Jan 08 '12 at 21:46
  • Yes, I had the same idea: http://jsfiddle.net/NcJWj/ - I realise you said it was intermittent, but... (I'm on Chrome 16.0.912.75 m.) – nnnnnn Jan 08 '12 at 21:48

1 Answers1

0

Your code works perfectly on my chrome browser (version:16.0.912.75), especially when the return value is set to true.

Do you have any chrome extensions installed? Disable all of your chrome extensions to isolate the problem. Also, type in about:flags in your address bar, then disable all of the enabled experimental features.

If the problem does not go away, then just stick to typing return false;, to prevent these weird problems from occurring.

auroranil
  • 2,621
  • 6
  • 24
  • 34
  • Apologies for the long delay, work has been very demanding recently.. and thanks for all the quick replies. Can you confirm this page works in Chrome as well then, because that exact problem was isolated from this page. http://jsfiddle.net/steveterm/7T9N8/ What I said above applies to this page as well. – user1137619 Jan 16 '12 at 21:24
  • 1
    I found the issue in the code. If you drag the text to anywhere else, it will cause the onmouseup event to not trigger. – auroranil Jan 17 '12 at 00:08
  • 1
    You may want to edit your post, or create a new one called `Dragging text prevents mouseup from trigging`. – auroranil Jan 17 '12 at 00:16
  • followed your advice :) http://stackoverflow.com/questions/8900794/dragging-text-prevents-mouseup-from-trigging-javascript-chrome – user1137619 Jan 17 '12 at 19:51