diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 87af50eb0..539dce200 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -196,7 +196,7 @@ define([ $(document.body).on('blur', 'input, textarea', function(e) { if (!me.isModalShowed) { if (!e.relatedTarget || - !/area_id/.test(e.target.id) && (e.relatedTarget.localName != 'input' || $(e.target).parent().find(e.relatedTarget).length<1) /* Check if focus in combobox goes from input to it's menu button or menu items */ + !/area_id/.test(e.target.id) && ($(e.target).parent().find(e.relatedTarget).length<1 || e.target.localName == 'textarea') /* Check if focus in combobox goes from input to it's menu button or menu items, or from comment editing area to Ok/Cancel button */ && (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */ && (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ { me.api.asc_enableKeyEvents(true); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 3ef344dd3..8921a30ce 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -192,7 +192,7 @@ define([ $(document.body).on('blur', 'input, textarea', function(e) { if (!me.isModalShowed) { if (!e.relatedTarget || - !/area_id/.test(e.target.id) && (e.relatedTarget.localName != 'input' || $(e.target).parent().find(e.relatedTarget).length<1) /* Check if focus in combobox goes from input to it's menu button or menu items */ + !/area_id/.test(e.target.id) && ($(e.target).parent().find(e.relatedTarget).length<1 || e.target.localName == 'textarea') /* Check if focus in combobox goes from input to it's menu button or menu items, or from comment editing area to Ok/Cancel button */ && (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */ && (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ { me.api.asc_enableKeyEvents(true); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 8aef78da9..3a3f563a3 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -201,7 +201,7 @@ define([ if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible())) { if (!e.relatedTarget || - !/area_id/.test(e.target.id) && (e.relatedTarget.localName != 'input' || $(e.target).parent().find(e.relatedTarget).length<1) /* Check if focus in combobox goes from input to it's menu button or menu items */ + !/area_id/.test(e.target.id) && ($(e.target).parent().find(e.relatedTarget).length<1 || e.target.localName == 'textarea') /* Check if focus in combobox goes from input to it's menu button or menu items, or from comment editing area to Ok/Cancel button */ && (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */ && (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ { me.api.asc_enableKeyEvents(true);