Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 a > span won't trigger right click link menu

Ok, this is going to be an interesting one...

Pretty much I seem to have run into an interesting IE bug (feature) involving when a span is inside an anchor eg.

<a href='#'>
    <span style="float:left;">Super cool link</span>
    <span style="float:right;">10</span>
</a>

In IE, you seem to be able to left click through but you cannot right click on the item and get the link menu, this problem seems to be persistent across Google's services too, eg.

IE Bug Example

I'm wondering if anyone could shed some light on

  1. The cause of why this is happening
  2. A solution to this or a workaround

So far I have tried adding a &nbsp; in the anchor and fiddled with z-indexes to no avail.

The only solution / workaround I can find is if you remove the Doctype the issue seems to go away. (not going to happen)

Ninja edit - You can't seem to CTRL + Click either

Ok another edit:

Looks like display: block; on the span kills it - http://jsfiddle.net/vdfhz/4/

like image 607
csilk Avatar asked Nov 04 '22 10:11

csilk


1 Answers

Ok, answering my own question, should have just spend more time on it.

Looks like if you have anything other than display: inline; on the span it won't work.

http://jsfiddle.net/vdfhz/9/

Thanks for giving it a go everyone, hope this will help someone in the future

like image 192
csilk Avatar answered Nov 08 '22 08:11

csilk