Embedded image styling


I am try to make an Image undraggable or unselectable. Below is the code for creating a embedded object:

Embedded embeddedRsc = new Embedded(“”, new ThemeResource(“img/picture1.png”));
embeddedRsc .addStyleName(“disableDrag”);

And the CSS is as follows:

​.v-embedded-disableDrag img {

But the image remains draggable and the firebug does not include the above tag set by the CSS however the style name does come up. Is there anything wrong with the above CSS?


this is because draggable is not a CSS rule, it should be set as a property on the img element itself. Like this:

<img draggable="false" ... />

The problem is that there’s really no way to set such properties with Vaadin. If you’re on Vaadin 7, you could just write a simple Extension that would just add the property to the image element on the client side.