loleaflet/src/control/Control.LokDialog.js |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 0a5032e64cb63a4a2ddeef2bbdfb096369b3f172
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Wed Mar 27 11:26:57 2019 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Wed Mar 27 12:10:06 2019 +0200

    Make tapping an element in a combo box actually work (on touch devices)
    
    If we get a 'touchend' immediately after a 'touchstart', simulate a
    'mousedown' immediately followed by a 'mouseup'.
    
    Change-Id: Ib20eae4cc23518e34a1d948f8e498f50046f72d7

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 7ad6ccade..1836bf7a2 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -10,6 +10,7 @@ L.WinUtil = {
 
 var firstTouchPositionX = null;
 var firstTouchPositionY = null;
+var previousTouchType = null;
 
 function updateTransformation(target) {
        if (target !== null && target !== undefined) {
@@ -688,6 +689,11 @@ L.Control.LokDialog = L.Control.extend({
                        else if (e.type === 'touchend')
                        {
                                this._postWindowGestureEvent(childId, 'panEnd', 
firstTouchPositionX, firstTouchPositionY, firstTouchPositionY - touchY);
+                               if (previousTouchType === 'touchstart') {
+                                       // Simulate mouse click
+                                       
this._postWindowMouseEvent('buttondown', childId, firstTouchPositionX, 
firstTouchPositionY, 1, this._map['mouse'].LOButtons.left, 0);
+                                       this._postWindowMouseEvent('buttonup', 
childId, firstTouchPositionX, firstTouchPositionY, 1, 
this._map['mouse'].LOButtons.left, 0);
+                               }
                                firstTouchPositionX = null;
                                firstTouchPositionY = null;
 
@@ -696,6 +702,7 @@ L.Control.LokDialog = L.Control.extend({
                        {
                                this._postWindowGestureEvent(childId, 
'panUpdate', firstTouchPositionX, firstTouchPositionY, firstTouchPositionY - 
touchY);
                        }
+                       previousTouchType = e.type;
                }, this);
 
                L.DomEvent.on(canvas, 'mousedown mouseup', function(e) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to