Commit 848d01c7 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

parents 205196a1 33dd6614
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
this.TextInputAfterComposition = false; this.TextInputAfterComposition = false;
this.IsLockTargetMode = false; this.IsLockTargetMode = false;
this.IsUseFirstTextInputAfterComposition = false;
} }
CTextInput.prototype = CTextInput.prototype =
...@@ -74,6 +76,7 @@ ...@@ -74,6 +76,7 @@
this.HtmlArea["onkeyup"] = function(e) { return oThis.onKeyUp(e); }; this.HtmlArea["onkeyup"] = function(e) { return oThis.onKeyUp(e); };
this.HtmlArea.addEventListener("input", function(e) { return oThis.onInput(e); }, false); this.HtmlArea.addEventListener("input", function(e) { return oThis.onInput(e); }, false);
this.HtmlArea.addEventListener("textInput", function(e) { return oThis.onTextInput(e); }, false);
this.HtmlArea.addEventListener("compositionstart", function(e) { return oThis.onCompositionStart(e); }, false); this.HtmlArea.addEventListener("compositionstart", function(e) { return oThis.onCompositionStart(e); }, false);
this.HtmlArea.addEventListener("compositionupdate", function(e) { return oThis.onCompositionUpdate(e); }, false); this.HtmlArea.addEventListener("compositionupdate", function(e) { return oThis.onCompositionUpdate(e); }, false);
...@@ -146,6 +149,15 @@ ...@@ -146,6 +149,15 @@
this.clear(); this.clear();
}, },
onTextInput : function(e)
{
if (this.IsUseFirstTextInputAfterComposition)
{
this.onCompositionEnd(e);
this.IsUseFirstTextInputAfterComposition = false;
}
},
onKeyDown : function(e) onKeyDown : function(e)
{ {
// некоторые рукописные вводы не присылают keyUp // некоторые рукописные вводы не присылают keyUp
...@@ -270,8 +282,18 @@ ...@@ -270,8 +282,18 @@
onCompositionEnd : function(e) onCompositionEnd : function(e)
{ {
// chrome, linux: всегда приходит пустая дата // chrome, linux: всегда приходит пустая дата
if (e.data !== undefined && (e.data !== "" || (this.compositionValue.length == 0))) if (!this.IsUseFirstTextInputAfterComposition)
{
if (e.data === undefined || (e.data == "" && (this.compositionValue.length != 0)))
{
this.IsUseFirstTextInputAfterComposition = true;
return;
}
}
else
{
this.onCompositionUpdate(e, false); this.onCompositionUpdate(e, false);
}
this.Listener.Set_CursorPosInCompositeText(1000); // max this.Listener.Set_CursorPosInCompositeText(1000); // max
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment