From 594cabd5f859bb66eebf16491a41ccd2f7d527cc Mon Sep 17 00:00:00 2001 From: Pekka Hyvönen Date: Fri, 5 May 2017 12:39:32 +0300 Subject: Fix HTML5 DnD regression for FF (#9245) - Always set some drag data - Set the dropEffect on dragEnter and dragOver events on drop target - Send the dropEffect to server on drop event with disclaimer of current support - Remove _dragOverCriteria_ and use _dropCriteria_ for `dragenter`, `dragover` and `drop` criteria Tested manually basic DnD and Grid DnD on Mac with Chrome, Firefox, Safari. Safari is still missing drag image (regression). Tested manually basic DnD and Grid Dnd on Windows IE11 and Edge. Drop event for both is still not working properly #9174. --- shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java | 8 +++++--- .../src/main/java/com/vaadin/shared/ui/dnd/DropTargetState.java | 5 ----- .../main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java | 4 +++- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'shared/src') diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java index 7a608068a1..a889fce098 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java @@ -30,8 +30,10 @@ public interface DropTargetRpc extends ServerRpc { * Called when drop event happens on client side. * * @param dataTransferText - * Data of type {@code "text"} from the {@code DataTransfer} - * object. + * Data of type {@code "text"} from the {@code DataTransfer} + * object. + * @param dropEffect + * the desired drop effect */ - public void drop(String dataTransferText); + public void drop(String dataTransferText, String dropEffect); } diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetState.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetState.java index 8605a78b25..c36d97f1dc 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetState.java @@ -29,11 +29,6 @@ public class DropTargetState extends SharedState { */ public DropEffect dropEffect; - /** - * Criteria script to allow dragOver event on the element - */ - public String dragOverCriteria; - /** * Criteria script to allow drop event on the element */ diff --git a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java index e0b51a0242..6fb4f39dd3 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/grid/GridDropTargetRpc.java @@ -32,11 +32,13 @@ public interface GridDropTargetRpc extends ServerRpc { * @param dataTransferText * Data of type {@code "text"} from the {@code DataTransfer} * object. + * @param dropEffect + * the desired drop effect * @param rowKey * Key of the row on which the drop event occured. * @param dropLocation * Location of the drop within the row. */ - public void drop(String dataTransferText, String rowKey, + public void drop(String dataTransferText, String dropEffect, String rowKey, DropLocation dropLocation); } -- cgit v1.2.3