diff options
author | Adam Wagner <wbadam@users.noreply.github.com> | 2017-04-27 21:24:13 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-04-27 22:24:13 +0300 |
commit | 6094f09c9ebb530984cc8a54a2e6070dc9760ee4 (patch) | |
tree | b7d565ab0481e95ac408d720068bd08f95309ebd | |
parent | da70f93704759dd72a9ae5f6abf9b41be432a415 (diff) | |
download | vaadin-framework-6094f09c9ebb530984cc8a54a2e6070dc9760ee4.tar.gz vaadin-framework-6094f09c9ebb530984cc8a54a2e6070dc9760ee4.zip |
Set transfer data only when not null (#9185)
* Set transfer data only when not null (#9178)
-rw-r--r-- | client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java b/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java index d87eac20a9..946f37a9b1 100644 --- a/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java +++ b/client/src/main/java/com/vaadin/client/extensions/DragSourceExtensionConnector.java @@ -150,8 +150,11 @@ public class DragSourceExtensionConnector extends AbstractExtensionConnector { setDragImage(event); // Set text data parameter - nativeEvent.getDataTransfer().setData(DragSourceState.DATA_TYPE_TEXT, - createDataTransferText(event)); + String dataTransferText = createDataTransferText(event); + if (dataTransferText != null && !dataTransferText.isEmpty()) { + nativeEvent.getDataTransfer() + .setData(DragSourceState.DATA_TYPE_TEXT, dataTransferText); + } // Initiate firing server side dragstart event when there is a // DragStartListener attached on the server side |