Skip to content

Commit

Permalink
Fix Window dragging on touch screen. (#12260) (#12264)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
Ansku and Jantoni1 authored Apr 13, 2021
1 parent 8c5e36b commit e8c78e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/main/java/com/vaadin/client/ui/VWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -1043,15 +1043,15 @@ && 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;
onDragEvent(headerDragPending);
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
Expand Down

0 comments on commit e8c78e6

Please sign in to comment.