Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT: How do I remove the focus indicator of a Canvas Widget?

I have created a Canvas using:

Canvas canvas = Canvas.createIfSupported();

and added it to the DOM via:

RootPanel.get("canvasContainer").add(canvas);

When I open up the page in Chrome and click it, it highlights with an orange focus border. In the Android browser, when touching the canvas, the entire canvas is highlighted with a semitransparent blue overlay, as well as a solid blue border, as if the canvas was selected.

How do I change this behavior, so that the canvas isn't highlighted in any way when clicked/touched?

like image 467
claesv Avatar asked Dec 16 '11 09:12

claesv


1 Answers

Add

canvas {
  outline: none;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0); /* mobile webkit */
}

into your canvas tag CSS.

like image 103
Strelok Avatar answered Oct 11 '22 15:10

Strelok