]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix Window dragging on touch screen. (#12260) (#12264)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Tue, 13 Apr 2021 13:24:21 +0000 (16:24 +0300)
committerGitHub <noreply@github.com>
Tue, 13 Apr 2021 13:24:21 +0000 (16:24 +0300)
* Fix Window dragging on touch screen. (#12260)

- Added check for touch move event in order to allow the same flow for
both mouse and touch events when dragging a Window by its header.
- Can be tested with SubwindowDraggability class.

Fixes #12257

Co-authored-by: Jakub Antoniak <j.antoniak8@gmail.com>
client/src/main/java/com/vaadin/client/ui/VWindow.java

index ff013ccf205ac3e18c6b78e087fcd25efce11e18..fb383359ce9b179bc412fd1e10c9b07bcdc41389 100644 (file)
@@ -1043,7 +1043,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
 
                     headerDragPending = event;
                     bubble = false;
-                } else if (type == Event.ONMOUSEMOVE
+                } else if ((type == Event.ONMOUSEMOVE || type == Event.ONTOUCHMOVE)
                         && headerDragPending != null) {
                     // ie won't work unless this is set here
                     dragging = true;
@@ -1051,7 +1051,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
                     onDragEvent(event);
                     headerDragPending = null;
                     bubble = false;
-                } else if (type != Event.ONMOUSEMOVE) {
+                } else if (type != Event.ONMOUSEMOVE && type != Event.ONTOUCHMOVE) {
                     // The event can propagate to the parent in case it is a
                     // mouse move event. This is needed for tooltips to work in
                     // header and footer, see Ticket #19073