]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes normal drag and drop events (regression since 7.1) and html5 style
authorMatti Tahvonen <matti@vaadin.com>
Thu, 26 Sep 2013 12:59:55 +0000 (15:59 +0300)
committerMatti Tahvonen <matti@vaadin.com>
Thu, 26 Sep 2013 13:07:39 +0000 (16:07 +0300)
D&D in IE10 (#12339)

Change-Id: Ied4504406ebbeab6ff464fb239f7b3f5987fbbd9

client/src/com/vaadin/client/ui/VDragAndDropWrapper.java
client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java

index 1c1173c295984257d83703e3abd836b23acfb3b7..ccd7e2758e46f313d884d2fe368a3aecc4104fa7 100644 (file)
@@ -332,11 +332,16 @@ public class VDragAndDropWrapper extends VCustomComponent implements
         vaadinDragEvent.setCurrentGwtEvent(event);
         getDropHandler().dragOver(vaadinDragEvent);
 
-        String s = event.getEffectAllowed();
-        if ("all".equals(s) || s.contains("opy")) {
-            event.setDropEffect("copy");
-        } else {
-            event.setDropEffect(s);
+        try {
+            String s = event.getEffectAllowed();
+            if ("all".equals(s) || s.contains("opy")) {
+                event.setDropEffect("copy");
+            } else {
+                event.setDropEffect(s);
+            }
+        } catch (Exception e) {
+            // IE10 throws exception here in getEffectAllowed, ignore it, let
+            // drop effect be whatever it is
         }
 
         try {
index b4cf008a38f6b4ebd3c29422362201ffc5fb3258..b911c28a071187d65571033aecb351e553607415 100644 (file)
@@ -374,6 +374,17 @@ public class VDragAndDropManager {
                         public void onPreviewNativeEvent(
                                 NativePreviewEvent event) {
                             int typeInt = event.getTypeInt();
+                            if (typeInt == -1
+                                    && event.getNativeEvent().getType()
+                                            .contains("MSPointer")) {
+                                /*
+                                 * Ignore MSPointer events, until they are
+                                 * properly used (might improve usability on
+                                 * touch devices).
+                                 */
+                                return;
+                            }
+
                             switch (typeInt) {
                             case Event.ONMOUSEOVER:
                                 if (dragElement == null) {