W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2011

onclick after removing element from document during onmouseup

From: Glenn Maynard <glenn@zewt.org>
Date: Sun, 27 Feb 2011 04:40:52 -0500
Message-ID: <AANLkTikNHi+LsrzQfEMPa-mLL1ejyp7o75ZXKou75ew7@mail.gmail.com>
To: www-dom@w3.org
If an element is removed from the document during mouseup, should the click
event still fire?

Example below.  In FF3/4, when the link is clicked, no click event is
dispatched and the link doesn't activate.  In Chrome 9, the click event
still fires.  (This doesn't happen with keydown/keypress; for that event
sequence, both browsers match FF.)

I think Gecko's behavior makes more sense.  I can't find this in the
spec--is this covered?

<a href="http://www.google.com" id="test">test</a>
var elem = document.getElementById("test");
elem.addEventListener("mouseup", function(e) {
}, false);

Glenn Maynard
Received on Sunday, 27 February 2011 09:41:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:17 UTC