From e8c78e60a0441b7ca0520bd065888e991e782a55 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Tue, 13 Apr 2021 16:24:21 +0300 Subject: [PATCH] Fix Window dragging on touch screen. (#12260) (#12264) * 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 --- client/src/main/java/com/vaadin/client/ui/VWindow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main/java/com/vaadin/client/ui/VWindow.java b/client/src/main/java/com/vaadin/client/ui/VWindow.java index ff013ccf205..fb383359ce9 100644 --- a/client/src/main/java/com/vaadin/client/ui/VWindow.java +++ b/client/src/main/java/com/vaadin/client/ui/VWindow.java @@ -1043,7 +1043,7 @@ && isKeyEnterOrSpace(event.getKeyCode()))) { 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 @@ && isKeyEnterOrSpace(event.getKeyCode()))) { 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