tags:

views:

50

answers:

2

Hello there,

tyrpx is a GWT / Google App Engine app that allows players to do typing races. I am trying to prevent people from selecting text to type (it's a quote). The quote is made of GWT labels. Is there a way to prevent people to select text? of to intercept a click over a panel or label?

See it here http://app.typrx.com then click on 'compete in a race'.

Thanks.

+1  A: 

You can make text unselectable via CSS using either/both of these:

user-select: none;
-moz-user-select: none;

http://www.w3.org/TR/2000/WD-css3-userint-20000216#user-select

Jason Hall
This seems to work on Firefox only. Chrome and IE still allow to select. Any Idea?
supercobra
+1  A: 

I've had the same issue and added a solution to the http://www.cobogw.org library. It handles all the browser specific implementations. You can add the library to your project or see how it's implemented and copy it to your own code. The method to use is:

CSS.setSelectable(getElement(), false);
Hilbrand
Many thanks. Great library you have btw. Love the button bar!
supercobra