From df360681ae33025f83415bfbc93391932ad13ed9 Mon Sep 17 00:00:00 2001 From: Adam Wagner Date: Wed, 17 May 2017 16:28:53 +0300 Subject: Fix DnD issues regarding data type text (#9347) * First dragged data should not contain new line character at the beginning * Return any of "text", "Text" or "text/plain" in the method of getDataTransferText() * Set only data of type "text" for IE on dragstart * Clarify return of getDataTransferText() method * Ignore generated data that is null --- .../main/java/com/vaadin/shared/ui/dnd/DragSourceState.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'shared/src/main/java/com/vaadin') diff --git a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java index 66323a91c6..0fefd05665 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/dnd/DragSourceState.java @@ -45,6 +45,19 @@ public class DragSourceState extends SharedState { */ public static final String DATA_TYPE_TEXT = "text"; + /** + * Data type {@code "Text"}. IE 11 stores data dragged from the desktop as + * "Text" with capital letter. + */ + public static final String DATA_TYPE_TEXT_IE = "Text"; + + /** + * Data type {@code "text/plain"} for reading data from {@code DataTransfer} + * object. Some browsers convert store data with {@code "text"} as {@code + * "text/plain"} when transferring data. + */ + public static final String DATA_TYPE_TEXT_PLAIN = "text/plain"; + public static final String RESOURCE_DRAG_IMAGE = "drag-image"; /** -- cgit v1.2.3