[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 07:56:55 UTC 2018


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

New commits:
commit b8d7dda8c493f135ec62358f0c07579238d10ef9
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Sep 19 14:30:32 2018 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Thu Sep 20 09:56:38 2018 +0200

    loleaflet: mobile: fix non composition input
    
    Change-Id: I6f72f888314baaef00549bb08bcfa78854a0b610
    Reviewed-on: https://gerrit.libreoffice.org/60779
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

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);
 	}


More information about the Libreoffice-commits mailing list