From 25524e53f537d12057e457b4b59f916278496a31 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Tue, 25 Aug 2020 14:06:46 +0300 Subject: [PATCH] [SSE] Bug 46133 --- apps/common/main/lib/component/TabBar.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/TabBar.js b/apps/common/main/lib/component/TabBar.js index 19ac737ee..2098f0735 100644 --- a/apps/common/main/lib/component/TabBar.js +++ b/apps/common/main/lib/component/TabBar.js @@ -222,6 +222,12 @@ define([ this.bar.trigger('tab:manual', this.bar, this.bar.tabs.indexOf(tab), tab); } else { tab.changeState(); + if (this.bar.isEditFormula) + setTimeout(function(){ + $('#ce-cell-content').focus(); + var $cellContent = $('#ce-cell-content')[0]; + $cellContent.selectionStart = $cellContent.selectionEnd = $cellContent.value.length; + }, 500); } } } @@ -250,7 +256,14 @@ define([ } else { this.bar.$el.find('ul > li > span').attr('draggable', 'false'); } - this.bar.trigger('tab:drag', this.bar.selectTabs); + if ($('#ce-cell-content').is(':focus')) + if (!this.bar.isEditFormula) { + $('#ce-cell-content').blur(); + } else { + setTimeout(function () { + $('#ce-cell-content').focus(); + }, 500) + } }, this) }); tab.$el.children().on(