diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2017-05-05 12:39:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 12:39:32 +0300 |
commit | 594cabd5f859bb66eebf16491a41ccd2f7d527cc (patch) | |
tree | f7a6690138de513804d40a3768ce2b2b7b5fe64b /shared | |
parent | f10c0dcc7ebbafccbf0e037432dc2c75949e8e67 (diff) | |
download | vaadin-framework-594cabd5f859bb66eebf16491a41ccd2f7d527cc.tar.gz vaadin-framework-594cabd5f859bb66eebf16491a41ccd2f7d527cc.zip |
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.
Diffstat (limited to 'shared')
3 files changed, 8 insertions, 9 deletions
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 @@ -30,11 +30,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 */ public String dropCriteria; 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); } |