loleaflet/src/control/Control.MobileInput.js |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit c47a27b49b44cd6d575117fabdeb7f324cd495b8
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Sep 19 14:30:32 2018 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Thu Sep 27 09:51:02 2018 -0400

    loleaflet: mobile: fix non composition input
    
    Change-Id: I6f72f888314baaef00549bb08bcfa78854a0b610

diff --git a/loleaflet/src/control/Control.MobileInput.js 
b/loleaflet/src/control/Control.MobileInput.js
index 312c99845..8d5f42664 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -91,17 +91,20 @@ L.Control.MobileInput = L.Control.extend({
 
                this._keyHandled = this._keyHandled || false;
                if (this._isComposing) {
+                       this._lastInput = null;
                        return;
                }
 
                docLayer._resetPreFetching();
                if (handler._ignoreKeyEvent({originalEvent: e})) {
+                       this._lastInput = null;
                        // key ignored
                }
                else if (e.type === 'keydown') {
                        this._keyHandled = false;
                        if (handler.handleOnKeyDownKeys[keyCode] && charCode 
=== 0) {
                                docLayer._postKeyboardEvent('input', charCode, 
unoKeyCode);
+                               this._lastInput = unoKeyCode;
                        }
                }
                else if ((e.type === 'keypress') && 
(!handler.handleOnKeyDownKeys[keyCode] || charCode !== 0)) {
@@ -113,10 +116,12 @@ L.Control.MobileInput = L.Control.extend({
                        }
 
                        docLayer._postKeyboardEvent('input', charCode, 
unoKeyCode);
+                       this._lastInput = unoKeyCode;
                        this._keyHandled = true;
                }
                else if (e.type === 'keyup') {
                        docLayer._postKeyboardEvent('up', charCode, unoKeyCode);
+                       this._lastInput = null;
                        this._keyHandled = true;
                }
                L.DomEvent.stopPropagation(e);
@@ -166,8 +171,9 @@ L.Control.MobileInput = L.Control.extend({
        },
 
        onInput: function (e) {
-               if (e.inputType && e.inputType === 'deleteContentBackward' && 
!this._keyHandled) {
-                       this._map._docLayer._postKeyboardEvent('input', 0, 
this._map.keyboard._toUNOKeyCode(8));
+               var backSpace = this._map.keyboard._toUNOKeyCode(8);
+               if (e.inputType && e.inputType === 'deleteContentBackward' && 
this._lastInput !== backSpace) {
+                       this._map._docLayer._postKeyboardEvent('input', 0, 
backSpace);
                }
                L.DomEvent.stopPropagation(e);
        }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to