loleaflet/src/map/handler/Map.Keyboard.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
New commits: commit 98f567461268e7ec855e95c0f74b3bd363ef7e3a Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Apr 11 14:12:32 2019 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri May 3 14:11:04 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 <hcas...@collabora.com> Tested-by: Henry Castro <hcas...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/71737 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@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. // _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits