nikhilbchilwant / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
1 stars 1 forks source link

GWTCanvas / IE: Canvas elements are selectable #261

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Concerning GWTCanvas (Internet Explorer VML Emulation)

What version of gwt and gwt-incubator are you using?
GWT: 1.6.3
GWT Incubator: 1.6 march-02-2009

What OS and browser are you using?
Windows XP/Vista/Whatever,  Internet Explorer (every version)

Do you see this error in hosted mode, web mode, or both?
Doesn't matter as long as it's IE

Test:
1. Draw elements (images/paths,...) on canvas (IE)
2. Hold left mouse button and drag over elements

What is the expected output? What do you see instead?
Expected: mouse drags over elements without selecting them
Instead: elements are being selected

Workaround:
After drawing the canvas, set the "unselectable" attribute to "on" for
every vml element after drawing to the canvas.

<code>
        NodeList<Element> elements =
Document.get().getElementsByTagName("<element_name>");
        for(int i=0; i<elements.getLength(); i++) {
            elements.getItem(i).setAttribute("unselectable", "on");
        }
</code>

Suggestion: set the "unselectable" attribute to "on" by default.

Original issue reported on code.google.com by marc.die...@gmail.com on 9 Apr 2009 at 2:15

GoogleCodeExporter commented 8 years ago
A better solution would be to attach a MouseDownHandler to your GWTCanvas  and 
call 
preventDefault() on the supplied event object.

Original comment by jaime...@google.com on 4 Aug 2009 at 11:58

GoogleCodeExporter commented 8 years ago

Original comment by jaime...@google.com on 4 Aug 2009 at 11:58