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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri May 3 12:11:37 UTC 2019


 loleaflet/src/map/handler/Map.Keyboard.js |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 20ff0a47bc886ae4839b363217b2f6100544facd
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Apr 11 14:12:32 2019 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri May 3 14:11:19 2019 +0200

    loleaflet: fix the input method when receives 'compositionend' event
    
    Change-Id: I296a714f41afb8a497e21661db0edf23d270b821
    Reviewed-on: https://gerrit.libreoffice.org/70607
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/70666
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 863473bae..b532c16a7 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -401,12 +401,8 @@ L.Map.Keyboard = L.Handler.extend({
 	_onIME: function (e) {
 		if (e.type === 'compositionstart' || e.type === 'compositionupdate') {
 			this._isComposing = true; // we are starting composing with IME
-			var txt = '';
-			for (var i = 0; i < e.originalEvent.data.length; i++) {
-				txt += e.originalEvent.data[i];
-			}
-			if (txt) {
-				this._map._docLayer._postCompositionEvent(0, 'input', txt);
+			if (e.originalEvent.data.length > 0) {
+				this._map._docLayer._postCompositionEvent(0, 'input', e.originalEvent.data);
 			}
 		}
 
@@ -417,10 +413,10 @@ L.Map.Keyboard = L.Handler.extend({
 			// is clear for the next word
 			this._map._clipboardContainer.setValue('');
 			// Set all keycodes to zero
-			this._map._docLayer._postCompositionEvent(0, 'end', '');
+			this._map._docLayer._postCompositionEvent(0, 'end', e.originalEvent.data);
 		}
 
-		if (e.type === 'textInput' && !this._keyHandled) {
+		if (e.type === 'textInput' && !this._keyHandled && !this._isComposing) {
 			// Hack for making space and spell-check text insert work
 			// in Chrome (on Andorid) or Chrome with IME.
 			//


More information about the Libreoffice-commits mailing list