claesv
claesv

Reputation: 2113

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?

Upvotes: 16

Views: 8209

Answers (1)

Strelok
Strelok

Reputation: 51461

Add

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

into your canvas tag CSS.

Upvotes: 35

Related Questions