Yan Abdullaev
Yan Abdullaev

Reputation: 11

firefox not trigger default handler

The problem is, why firefox (3-10) do not calls default link handler, when I`m using stop propagation and clicking link with Ctrl key? All other browsers, even including IE!, do that.

Code sample:

<a href="http://google.com">Click me</a>
<script type="text/javascript">
$('a').click(function(evt){
    evt.stopPropagation();
});
</script>

Just open firefox, hold down Ctrl key and click link. Nothing happens, why?

Upvotes: 1

Views: 198

Answers (2)

Pavel Shkleinik
Pavel Shkleinik

Reputation: 6347

Here is a bug, reported to bugzilla:

https://bugzilla.mozilla.org/show_bug.cgi?id=748740

You can vote for it :)

Upvotes: 1

Boris Zbarsky
Boris Zbarsky

Reputation: 35074

Because the "Ctrl+click" behavior is implemented in an event handler that Firefox attaches to the window (the actual setup is a bit more complicated, but that's what it looks like from the point of view of the web page) and you're preventing propagation of the event to that handler, so it never fires.

Upvotes: 1

Related Questions