javascripthtmlevent-handlingdom-eventssnap.svg

Handled double Click event selecting snap svg text


I'm using snapsvg for my project in which I'm handling dblclick event for some purpose (say browser window alert). That is when I chick on svg canvas, alert pops up. The problem is that when I click on canvas, some text on canvas also gets selected, which I don't want it to happen.

Any ideas how to get rid of it?

Here is the code on JsFiddle to reproduce the same problem. Click anywhere on canvas and observe the text as it gets selected.


Solution

  • As suggested by Alexandr Kiseloy, I have added #Canvas { user-select: none; } in css file and it solved my problem.