Commit 385af23a authored by Oleg Korshul's avatar Oleg Korshul

ie emulate keydown

parent 38ebc2c1
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
this.IsUseFirstTextInputAfterComposition = false; this.IsUseFirstTextInputAfterComposition = false;
this.nativeFocusElement = null; this.nativeFocusElement = null;
this.nativeFocusElementNoRemoveOnElementFocus = false;
this.InterfaceEnableKeyEvents = true; this.InterfaceEnableKeyEvents = true;
this.ieNonCompositionPrefix = ""; this.ieNonCompositionPrefix = "";
...@@ -1215,10 +1216,14 @@ ...@@ -1215,10 +1216,14 @@
document.addEventListener("focus", function(e) document.addEventListener("focus", function(e)
{ {
var t = window['AscCommon'].g_inputContext; var t = window['AscCommon'].g_inputContext;
var _oldNativeFE = t.nativeFocusElement;
t.nativeFocusElement = e.target; t.nativeFocusElement = e.target;
//console.log(t.nativeFocusElement); //console.log(t.nativeFocusElement);
var _nativeFocusElementNoRemoveOnElementFocus = t.nativeFocusElementNoRemoveOnElementFocus;
t.nativeFocusElementNoRemoveOnElementFocus = false;
if (t.InterfaceEnableKeyEvents == false) if (t.InterfaceEnableKeyEvents == false)
{ {
t.nativeFocusElement = null; t.nativeFocusElement = null;
...@@ -1228,7 +1233,12 @@ ...@@ -1228,7 +1233,12 @@
if (t.nativeFocusElement.id == t.HtmlArea.id) if (t.nativeFocusElement.id == t.HtmlArea.id)
{ {
t.Api.asc_enableKeyEvents(true, true); t.Api.asc_enableKeyEvents(true, true);
if (_nativeFocusElementNoRemoveOnElementFocus)
t.nativeFocusElement = _oldNativeFE;
else
t.nativeFocusElement = null; t.nativeFocusElement = null;
return; return;
} }
if (t.nativeFocusElement.id == window['AscCommon'].g_clipboardBase.CommonDivId) if (t.nativeFocusElement.id == window['AscCommon'].g_clipboardBase.CommonDivId)
...@@ -1237,6 +1247,8 @@ ...@@ -1237,6 +1247,8 @@
return; return;
} }
t.nativeFocusElementNoRemoveOnElementFocus = false;
var _isElementEditable = false; var _isElementEditable = false;
if (true) if (true)
{ {
...@@ -1293,6 +1305,7 @@ ...@@ -1293,6 +1305,7 @@
t.nativeFocusElement = null; t.nativeFocusElement = null;
var _elem = t.nativeFocusElement; var _elem = t.nativeFocusElement;
t.nativeFocusElementNoRemoveOnElementFocus = true; // ie focus async
t.HtmlArea.focus(); t.HtmlArea.focus();
t.nativeFocusElement = _elem; t.nativeFocusElement = _elem;
t.Api.asc_enableKeyEvents(true, true); t.Api.asc_enableKeyEvents(true, true);
......
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