I am developing a web application in HTML5 using SVG to draw paths and text. Testing with Chrome on OS X, I came across pretty ugly behavior that seems to be a bug in Chrome.
Consider the following minimal example of an SVG text traversed along a path:
<svg height="200" width="200"> <text x="50" y="50" fill="#000" font-size="50" style="pointer-events: none;"> <tspan x="5" dy="0">Test Text</tspan> </text> <path d="M 0 0 L 100 100" stroke="#000" stroke-width="5"></path> </svg>
( http://jsfiddle.net/wPYvS/ )
I donβt want the SVG text to be selected (or highlighted) when dragging it with the cursor. So I added the CSS attribute "pointer-events: none", which works as expected in all browsers except Chrome. In Chrome, when you drag only text, nothing is selected. But if you drag the text where the path is on the path (so you are actually dragging the path), the text is highlighted.
I was able to reproduce this on Chrome and OS X and Windows, but not with Firefox, Opera, or Safari.
Is there some workaround that I could use to prevent full text selection in all browsers?
Thanks in advance!
j0ker source share